Lite/Traits/Options.php 0000644 00000005230 15021221222 0011040 0 ustar 00 getDbOptions( $this->optionsName . '_lite' ); // Refactor options. $this->defaultsMerged = array_replace_recursive( $this->defaults, $this->liteDefaults ); $mergedDefaults = array_replace_recursive( $this->liteDefaults, $this->addValueToValuesArray( $this->liteDefaults, $dbOptions ) ); $cachedOptions = aioseo()->core->optionsCache->getOptions( $this->optionsName ); $dbOptions = array_replace_recursive( $cachedOptions, $mergedDefaults ); aioseo()->core->optionsCache->setOptions( $this->optionsName, $dbOptions ); } /** * Merge defaults with liteDefaults. * * @since 4.1.4 * * @return array An array of dafults. */ public function getDefaults() { return array_replace_recursive( parent::getDefaults(), $this->liteDefaults ); } /** * Updates the options in the database. * * @since 4.1.4 * * @param string $optionsName An optional option name to update. * @param string $defaults The defaults to filter the options by. * @param array|null $options An optional options array. * @return void */ public function update( $optionsName = null, $defaults = null, $options = null ) { $optionsName = empty( $optionsName ) ? $this->optionsName . '_lite' : $optionsName; $defaults = empty( $defaults ) ? $this->liteDefaults : $defaults; // We're creating a new array here because it was setting it by reference. $cachedOptions = aioseo()->core->optionsCache->getOptions( $this->optionsName ); $optionsBefore = json_decode( wp_json_encode( $cachedOptions ), true ); parent::update( $this->optionsName, $options ); parent::update( $optionsName, $defaults, $optionsBefore ); } /** * Updates the options in the database. * * @since 4.1.4 * * @param boolean $force Whether or not to force an immediate save. * @param string $optionsName An optional option name to update. * @param string $defaults The defaults to filter the options by. * @return void */ public function save( $force = false, $optionsName = null, $defaults = null ) { if ( ! $this->shouldSave && ! $force ) { return; } $optionsName = empty( $optionsName ) ? $this->optionsName . '_lite' : $optionsName; $defaults = empty( $defaults ) ? $this->liteDefaults : $defaults; parent::save( $force, $this->optionsName ); parent::save( $force, $optionsName, $defaults ); } } Lite/Utils/Helpers.php 0000644 00000001314 15021221222 0010640 0 ustar 00 routes, $this->liteRoutes ); } } Lite/Api/Wizard.php 0000644 00000002124 15021221222 0010107 0 ustar 00 get_json_params(); $section = ! empty( $body['section'] ) ? sanitize_text_field( $body['section'] ) : null; $wizard = ! empty( $body['wizard'] ) ? $body['wizard'] : null; // Save the smart recommendations section. if ( 'smartRecommendations' === $section && ! empty( $wizard['smartRecommendations'] ) ) { $smartRecommendations = $wizard['smartRecommendations']; if ( isset( $smartRecommendations['usageTracking'] ) ) { aioseo()->options->advanced->usageTracking = $smartRecommendations['usageTracking']; } } return $response; } } Lite/Options/InternalOptions.php 0000644 00000002071 15021221222 0012722 0 ustar 00 [ 'activated' => [ 'type' => 'number', 'default' => 0 ], 'firstActivated' => [ 'type' => 'number', 'default' => 0 ], 'installed' => [ 'type' => 'number', 'default' => 0 ], 'connect' => [ 'key' => [ 'type' => 'string' ], 'time' => [ 'type' => 'number', 'default' => 0 ], 'network' => [ 'type' => 'boolean', 'default' => false ], 'token' => [ 'type' => 'string' ] ] ] // phpcs:enable WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound ]; } Lite/Options/Options.php 0000644 00000002371 15021221222 0011230 0 ustar 00 [ 'usageTracking' => [ 'type' => 'boolean', 'default' => false ] ] // phpcs:enable WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound ]; /** * Sanitizes, then saves the options to the database. * * @since 4.7.2 * * @param array $options An array of options to sanitize, then save. * @return void */ public function sanitizeAndSave( $options ) { if ( isset( $options['advanced']['emailSummary']['recipients'] ) ) { $options['advanced']['emailSummary']['recipients'] = [ array_shift( $options['advanced']['emailSummary']['recipients'] ) ]; $options['advanced']['emailSummary']['recipients'][0]['frequency'] = 'monthly'; } parent::sanitizeAndSave( $options ); } } Lite/Main/Filters.php 0000644 00000005774 15021221222 0010450 0 ustar 00 ', 5 ); $actionLinks = [ 'suggest-feature' => [ // Translators: This is an action link users can click to open a feature request. 'label' => __( 'Suggest a Feature', 'all-in-one-seo-pack' ), 'url' => aioseo()->helpers->utmUrl( AIOSEO_MARKETING_URL . 'suggest-a-feature/', 'plugin-row-meta', 'feature' ), ], 'review' => [ 'label' => $reviewLabel, 'url' => aioseo()->helpers->utmUrl( AIOSEO_MARKETING_URL . 'review-aioseo', 'plugin-row-meta', 'review' ), 'title' => sprintf( // Translators: 1 - The plugin short name ("AIOSEO"). __( 'Rate %1$s', 'all-in-one-seo-pack' ), 'AIOSEO' ) ] ]; return $this->parseActionLinks( $actions, $pluginFile, $actionLinks ); } /** * Registers our action links for the plugins page. * * @since 4.0.0 * * @param array $actions List of existing actions. * @param string $pluginFile The plugin file. * @return array List of action links. */ public function pluginActionLinks( $actions, $pluginFile = '' ) { $actionLinks = [ 'settings' => [ 'label' => __( 'SEO Settings', 'all-in-one-seo-pack' ), 'url' => get_admin_url( null, 'admin.php?page=aioseo-settings' ), ], 'support' => [ // Translators: This is an action link users can click to open our premium support. 'label' => __( 'Support', 'all-in-one-seo-pack' ), 'url' => aioseo()->helpers->utmUrl( AIOSEO_MARKETING_URL . 'contact/', 'plugin-action-links', 'Support' ), ], 'docs' => [ // Translators: This is an action link users can click to open our general documentation page. 'label' => __( 'Documentation', 'all-in-one-seo-pack' ), 'url' => aioseo()->helpers->utmUrl( AIOSEO_MARKETING_URL . 'docs/', 'plugin-action-links', 'Documentation' ), ], 'proupgrade' => [ // Translators: This is an action link users can click to purchase a license for All in One SEO Pro. 'label' => __( 'Upgrade to Pro', 'all-in-one-seo-pack' ), 'url' => apply_filters( 'aioseo_upgrade_link', aioseo()->helpers->utmUrl( AIOSEO_MARKETING_URL . 'lite-upgrade/', 'plugin-action-links', 'Upgrade', false ) ), ] ]; if ( isset( $actions['edit'] ) ) { unset( $actions['edit'] ); } return $this->parseActionLinks( $actions, $pluginFile, $actionLinks, 'before' ); } } Lite/Views/taxonomy-upsell.php 0000644 00000133476 15021221222 0012432 0 ustar 00