rebase on oct-10-2023
This commit is contained in:
@@ -109,7 +109,6 @@ class Aioseo_Cleanup_Action extends Abstract_Aioseo_Importing_Action {
|
||||
$aioseo_table_truncate_done = $this->wpdb->query( $this->truncate_query() );
|
||||
// phpcs:enable WordPress.DB.PreparedSQL.NotPrepared
|
||||
|
||||
|
||||
if ( $meta_data === false && $aioseo_table_truncate_done === false ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -114,7 +114,6 @@ class Aioseo_Validate_Data_Action extends Abstract_Aioseo_Importing_Action {
|
||||
$validated_aioseo_settings = $this->validate_aioseo_settings();
|
||||
$validated_robot_settings = $this->validate_robot_settings();
|
||||
|
||||
|
||||
if ( $validated_aioseo_table === false || $validated_aioseo_settings === false || $validated_robot_settings === false ) {
|
||||
throw new Aioseo_Validation_Exception();
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@ abstract class Abstract_Indexing_Action implements Indexation_Action_Interface,
|
||||
}
|
||||
|
||||
\set_transient( static::UNINDEXED_COUNT_TRANSIENT, $count, \DAY_IN_SECONDS );
|
||||
|
||||
/**
|
||||
* Action: 'wpseo_indexables_unindexed_calculated' - sets an option to timestamp when there are no unindexed indexables left.
|
||||
*
|
||||
|
||||
@@ -53,9 +53,9 @@ class Indexable_Post_Type_Archive_Indexation_Action implements Indexation_Action
|
||||
* Indexation_Post_Type_Archive_Action constructor.
|
||||
*
|
||||
* @param Indexable_Repository $repository The indexable repository.
|
||||
* @param Indexable_Builder $builder The indexable builder.
|
||||
* @param Post_Type_Helper $post_type The post type helper.
|
||||
* @param Indexable_Builder_Versions $versions The current versions of all indexable builders.
|
||||
* @param Indexable_Builder $builder The indexable builder.
|
||||
* @param Post_Type_Helper $post_type The post type helper.
|
||||
* @param Indexable_Builder_Versions $versions The current versions of all indexable builders.
|
||||
*/
|
||||
public function __construct(
|
||||
Indexable_Repository $repository,
|
||||
|
||||
@@ -28,8 +28,8 @@ class Integrations_Action {
|
||||
/**
|
||||
* Sets an integration state.
|
||||
*
|
||||
* @param string $integration_name The name of the integration to activate/deactivate.
|
||||
* @param boolean $value The value to store.
|
||||
* @param string $integration_name The name of the integration to activate/deactivate.
|
||||
* @param bool $value The value to store.
|
||||
*
|
||||
* @return object The response object.
|
||||
*/
|
||||
|
||||
@@ -94,4 +94,3 @@ class SEMrush_Phrases_Action {
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,8 @@ use Yoast\WP\SEO\Helpers\Options_Helper;
|
||||
*/
|
||||
class Wincher_Account_Action {
|
||||
|
||||
const ACCOUNT_URL = 'https://api.wincher.com/beta/account';
|
||||
const ACCOUNT_URL = 'https://api.wincher.com/beta/account';
|
||||
const UPGRADE_CAMPAIGN_URL = 'https://api.wincher.com/v1/yoast/upgrade-campaign';
|
||||
|
||||
/**
|
||||
* The Wincher_Client instance.
|
||||
@@ -63,4 +64,39 @@ class Wincher_Account_Action {
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the upgrade campaign.
|
||||
*
|
||||
* @return object The response object.
|
||||
*/
|
||||
public function get_upgrade_campaign() {
|
||||
try {
|
||||
$result = $this->client->get( self::UPGRADE_CAMPAIGN_URL );
|
||||
$type = $result['type'];
|
||||
$months = $result['months'];
|
||||
|
||||
// We display upgrade discount only if it's a rate discount and positive months.
|
||||
if ( $type === 'RATE' && $months && $months > 0 ) {
|
||||
$discount = $result['value'];
|
||||
|
||||
return (object) [
|
||||
'discount' => $discount,
|
||||
'months' => $months,
|
||||
'status' => 200,
|
||||
];
|
||||
}
|
||||
|
||||
return (object) [
|
||||
'discount' => null,
|
||||
'months' => null,
|
||||
'status' => 200,
|
||||
];
|
||||
} catch ( \Exception $e ) {
|
||||
return (object) [
|
||||
'status' => $e->getCode(),
|
||||
'error' => $e->getMessage(),
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,8 +275,6 @@ class Wincher_Keyphrases_Action {
|
||||
* @return array
|
||||
*/
|
||||
protected function collect_all_keyphrases() {
|
||||
global $wpdb;
|
||||
|
||||
// Collect primary keyphrases first.
|
||||
$keyphrases = \array_column(
|
||||
$this->indexable_repository
|
||||
@@ -347,7 +345,7 @@ class Wincher_Keyphrases_Action {
|
||||
*/
|
||||
protected function to_result_object( $result ) {
|
||||
if ( \array_key_exists( 'data', $result ) ) {
|
||||
$result['results'] = $result['data'];
|
||||
$result['results'] = (object) $result['data'];
|
||||
|
||||
unset( $result['data'] );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user