@@ -9,69 +9,69 @@ |
||
| 9 | 9 | |
| 10 | 10 | class Upgrade_4_0_2 |
| 11 | 11 | { |
| 12 | - use Arr; |
|
| 12 | + use Arr; |
|
| 13 | 13 | |
| 14 | - public function __construct() |
|
| 15 | - { |
|
| 16 | - $this->migrateSettings(); |
|
| 17 | - $this->protectMetaKeys(); |
|
| 18 | - $this->deleteSessions(); |
|
| 19 | - delete_transient(Application::ID.'_cloudflare_ips'); |
|
| 20 | - } |
|
| 14 | + public function __construct() |
|
| 15 | + { |
|
| 16 | + $this->migrateSettings(); |
|
| 17 | + $this->protectMetaKeys(); |
|
| 18 | + $this->deleteSessions(); |
|
| 19 | + delete_transient(Application::ID.'_cloudflare_ips'); |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * @return void |
|
| 24 | - */ |
|
| 25 | - public function deleteSessions() |
|
| 26 | - { |
|
| 27 | - global $wpdb; |
|
| 28 | - $wpdb->query(" |
|
| 22 | + /** |
|
| 23 | + * @return void |
|
| 24 | + */ |
|
| 25 | + public function deleteSessions() |
|
| 26 | + { |
|
| 27 | + global $wpdb; |
|
| 28 | + $wpdb->query(" |
|
| 29 | 29 | DELETE |
| 30 | 30 | FROM {$wpdb->options} |
| 31 | 31 | WHERE option_name LIKE '_glsr_session%' |
| 32 | 32 | "); |
| 33 | - } |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * @return void |
|
| 37 | - */ |
|
| 38 | - public function migrateSettings() |
|
| 39 | - { |
|
| 40 | - if ($settings = get_option(OptionManager::databaseKey(3))) { |
|
| 41 | - $multilingual = 'yes' == $this->dataGet($settings, 'settings.general.support.polylang') |
|
| 42 | - ? 'polylang' |
|
| 43 | - : ''; |
|
| 44 | - $settings = $this->dataSet($settings, 'settings.general.multilingual', $multilingual); |
|
| 45 | - $settings = $this->dataSet($settings, 'settings.general.rebusify', 'no'); |
|
| 46 | - $settings = $this->dataSet($settings, 'settings.general.rebusify_email', ''); |
|
| 47 | - $settings = $this->dataSet($settings, 'settings.general.rebusify_serial', ''); |
|
| 48 | - $settings = $this->dataSet($settings, 'settings.reviews.name.format', ''); |
|
| 49 | - $settings = $this->dataSet($settings, 'settings.reviews.name.initial', ''); |
|
| 50 | - $settings = $this->dataSet($settings, 'settings.submissions.blacklist.integration', ''); |
|
| 51 | - $settings = $this->dataSet($settings, 'settings.submissions.limit', ''); |
|
| 52 | - $settings = $this->dataSet($settings, 'settings.submissions.limit_whitelist.email', ''); |
|
| 53 | - $settings = $this->dataSet($settings, 'settings.submissions.limit_whitelist.ip_address', ''); |
|
| 54 | - $settings = $this->dataSet($settings, 'settings.submissions.limit_whitelist.username', ''); |
|
| 55 | - unset($settings['settings']['general']['support']); |
|
| 56 | - update_option(OptionManager::databaseKey(4), $settings); |
|
| 57 | - } |
|
| 58 | - } |
|
| 35 | + /** |
|
| 36 | + * @return void |
|
| 37 | + */ |
|
| 38 | + public function migrateSettings() |
|
| 39 | + { |
|
| 40 | + if ($settings = get_option(OptionManager::databaseKey(3))) { |
|
| 41 | + $multilingual = 'yes' == $this->dataGet($settings, 'settings.general.support.polylang') |
|
| 42 | + ? 'polylang' |
|
| 43 | + : ''; |
|
| 44 | + $settings = $this->dataSet($settings, 'settings.general.multilingual', $multilingual); |
|
| 45 | + $settings = $this->dataSet($settings, 'settings.general.rebusify', 'no'); |
|
| 46 | + $settings = $this->dataSet($settings, 'settings.general.rebusify_email', ''); |
|
| 47 | + $settings = $this->dataSet($settings, 'settings.general.rebusify_serial', ''); |
|
| 48 | + $settings = $this->dataSet($settings, 'settings.reviews.name.format', ''); |
|
| 49 | + $settings = $this->dataSet($settings, 'settings.reviews.name.initial', ''); |
|
| 50 | + $settings = $this->dataSet($settings, 'settings.submissions.blacklist.integration', ''); |
|
| 51 | + $settings = $this->dataSet($settings, 'settings.submissions.limit', ''); |
|
| 52 | + $settings = $this->dataSet($settings, 'settings.submissions.limit_whitelist.email', ''); |
|
| 53 | + $settings = $this->dataSet($settings, 'settings.submissions.limit_whitelist.ip_address', ''); |
|
| 54 | + $settings = $this->dataSet($settings, 'settings.submissions.limit_whitelist.username', ''); |
|
| 55 | + unset($settings['settings']['general']['support']); |
|
| 56 | + update_option(OptionManager::databaseKey(4), $settings); |
|
| 57 | + } |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - /** |
|
| 61 | - * @return void |
|
| 62 | - */ |
|
| 63 | - public function protectMetaKeys() |
|
| 64 | - { |
|
| 65 | - global $wpdb; |
|
| 66 | - $keys = array_keys(glsr(CreateReviewDefaults::class)->defaults()); |
|
| 67 | - $keys = implode("','", $keys); |
|
| 68 | - $postType = Application::POST_TYPE; |
|
| 69 | - $wpdb->query(" |
|
| 60 | + /** |
|
| 61 | + * @return void |
|
| 62 | + */ |
|
| 63 | + public function protectMetaKeys() |
|
| 64 | + { |
|
| 65 | + global $wpdb; |
|
| 66 | + $keys = array_keys(glsr(CreateReviewDefaults::class)->defaults()); |
|
| 67 | + $keys = implode("','", $keys); |
|
| 68 | + $postType = Application::POST_TYPE; |
|
| 69 | + $wpdb->query(" |
|
| 70 | 70 | UPDATE {$wpdb->postmeta} pm |
| 71 | 71 | INNER JOIN {$wpdb->posts} p ON p.id = pm.post_id |
| 72 | 72 | SET pm.meta_key = CONCAT('_', pm.meta_key) |
| 73 | 73 | WHERE pm.meta_key IN ('{$keys}') |
| 74 | 74 | AND p.post_type = '{$postType}' |
| 75 | 75 | "); |
| 76 | - } |
|
| 76 | + } |
|
| 77 | 77 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | $this->migrateSettings(); |
| 17 | 17 | $this->protectMetaKeys(); |
| 18 | 18 | $this->deleteSessions(); |
| 19 | - delete_transient(Application::ID.'_cloudflare_ips'); |
|
| 19 | + delete_transient( Application::ID.'_cloudflare_ips' ); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | /** |
@@ -25,11 +25,11 @@ discard block |
||
| 25 | 25 | public function deleteSessions() |
| 26 | 26 | { |
| 27 | 27 | global $wpdb; |
| 28 | - $wpdb->query(" |
|
| 28 | + $wpdb->query( " |
|
| 29 | 29 | DELETE |
| 30 | 30 | FROM {$wpdb->options} |
| 31 | 31 | WHERE option_name LIKE '_glsr_session%' |
| 32 | - "); |
|
| 32 | + " ); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -37,23 +37,23 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public function migrateSettings() |
| 39 | 39 | { |
| 40 | - if ($settings = get_option(OptionManager::databaseKey(3))) { |
|
| 41 | - $multilingual = 'yes' == $this->dataGet($settings, 'settings.general.support.polylang') |
|
| 40 | + if( $settings = get_option( OptionManager::databaseKey( 3 ) ) ) { |
|
| 41 | + $multilingual = 'yes' == $this->dataGet( $settings, 'settings.general.support.polylang' ) |
|
| 42 | 42 | ? 'polylang' |
| 43 | 43 | : ''; |
| 44 | - $settings = $this->dataSet($settings, 'settings.general.multilingual', $multilingual); |
|
| 45 | - $settings = $this->dataSet($settings, 'settings.general.rebusify', 'no'); |
|
| 46 | - $settings = $this->dataSet($settings, 'settings.general.rebusify_email', ''); |
|
| 47 | - $settings = $this->dataSet($settings, 'settings.general.rebusify_serial', ''); |
|
| 48 | - $settings = $this->dataSet($settings, 'settings.reviews.name.format', ''); |
|
| 49 | - $settings = $this->dataSet($settings, 'settings.reviews.name.initial', ''); |
|
| 50 | - $settings = $this->dataSet($settings, 'settings.submissions.blacklist.integration', ''); |
|
| 51 | - $settings = $this->dataSet($settings, 'settings.submissions.limit', ''); |
|
| 52 | - $settings = $this->dataSet($settings, 'settings.submissions.limit_whitelist.email', ''); |
|
| 53 | - $settings = $this->dataSet($settings, 'settings.submissions.limit_whitelist.ip_address', ''); |
|
| 54 | - $settings = $this->dataSet($settings, 'settings.submissions.limit_whitelist.username', ''); |
|
| 44 | + $settings = $this->dataSet( $settings, 'settings.general.multilingual', $multilingual ); |
|
| 45 | + $settings = $this->dataSet( $settings, 'settings.general.rebusify', 'no' ); |
|
| 46 | + $settings = $this->dataSet( $settings, 'settings.general.rebusify_email', '' ); |
|
| 47 | + $settings = $this->dataSet( $settings, 'settings.general.rebusify_serial', '' ); |
|
| 48 | + $settings = $this->dataSet( $settings, 'settings.reviews.name.format', '' ); |
|
| 49 | + $settings = $this->dataSet( $settings, 'settings.reviews.name.initial', '' ); |
|
| 50 | + $settings = $this->dataSet( $settings, 'settings.submissions.blacklist.integration', '' ); |
|
| 51 | + $settings = $this->dataSet( $settings, 'settings.submissions.limit', '' ); |
|
| 52 | + $settings = $this->dataSet( $settings, 'settings.submissions.limit_whitelist.email', '' ); |
|
| 53 | + $settings = $this->dataSet( $settings, 'settings.submissions.limit_whitelist.ip_address', '' ); |
|
| 54 | + $settings = $this->dataSet( $settings, 'settings.submissions.limit_whitelist.username', '' ); |
|
| 55 | 55 | unset($settings['settings']['general']['support']); |
| 56 | - update_option(OptionManager::databaseKey(4), $settings); |
|
| 56 | + update_option( OptionManager::databaseKey( 4 ), $settings ); |
|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | |
@@ -63,15 +63,15 @@ discard block |
||
| 63 | 63 | public function protectMetaKeys() |
| 64 | 64 | { |
| 65 | 65 | global $wpdb; |
| 66 | - $keys = array_keys(glsr(CreateReviewDefaults::class)->defaults()); |
|
| 67 | - $keys = implode("','", $keys); |
|
| 66 | + $keys = array_keys( glsr( CreateReviewDefaults::class )->defaults() ); |
|
| 67 | + $keys = implode( "','", $keys ); |
|
| 68 | 68 | $postType = Application::POST_TYPE; |
| 69 | - $wpdb->query(" |
|
| 69 | + $wpdb->query( " |
|
| 70 | 70 | UPDATE {$wpdb->postmeta} pm |
| 71 | 71 | INNER JOIN {$wpdb->posts} p ON p.id = pm.post_id |
| 72 | 72 | SET pm.meta_key = CONCAT('_', pm.meta_key) |
| 73 | 73 | WHERE pm.meta_key IN ('{$keys}') |
| 74 | 74 | AND p.post_type = '{$postType}' |
| 75 | - "); |
|
| 75 | + " ); |
|
| 76 | 76 | } |
| 77 | 77 | } |
@@ -1,20 +1,20 @@ |
||
| 1 | -<?php defined('WPINC') || die; ?> |
|
| 1 | +<?php defined( 'WPINC' ) || die; ?> |
|
| 2 | 2 | |
| 3 | 3 | <div class="wrap"> |
| 4 | 4 | <h1 class="wp-heading-inline"> |
| 5 | - <?= esc_html(get_admin_page_title()); ?> |
|
| 6 | - <a href="<?= admin_url('edit.php?post_type=site-review&page=welcome'); ?>" class="page-title-action"><?= __('About', 'site-reviews'); ?></a> |
|
| 5 | + <?= esc_html( get_admin_page_title() ); ?> |
|
| 6 | + <a href="<?= admin_url( 'edit.php?post_type=site-review&page=welcome' ); ?>" class="page-title-action"><?= __( 'About', 'site-reviews' ); ?></a> |
|
| 7 | 7 | </h1> |
| 8 | 8 | <?= $notices; ?> |
| 9 | - <p><?= __('Click an active tab to expand/collapse all sections.', 'site-reviews'); ?></p> |
|
| 9 | + <p><?= __( 'Click an active tab to expand/collapse all sections.', 'site-reviews' ); ?></p> |
|
| 10 | 10 | <h2 class="glsr-nav-tab-wrapper nav-tab-wrapper"> |
| 11 | - <?php foreach ($tabs as $id => $title) : ?> |
|
| 11 | + <?php foreach( $tabs as $id => $title ) : ?> |
|
| 12 | 12 | <a class="glsr-nav-tab nav-tab" href="#<?= $id; ?>"><?= $title; ?></a> |
| 13 | 13 | <?php endforeach; ?> |
| 14 | 14 | </h2> |
| 15 | - <?php foreach ($tabs as $id => $title) : ?> |
|
| 15 | + <?php foreach( $tabs as $id => $title ) : ?> |
|
| 16 | 16 | <div class="glsr-nav-view ui-tabs-hide" id="<?= $id; ?>"> |
| 17 | - <?php glsr()->render('pages/documentation/'.$id, $data); ?> |
|
| 17 | + <?php glsr()->render( 'pages/documentation/'.$id, $data ); ?> |
|
| 18 | 18 | </div> |
| 19 | 19 | <?php endforeach; ?> |
| 20 | 20 | <input type="hidden" name="_active_tab"> |