Plugin Directory

Changeset 3265467


Ignore:
Timestamp:
04/02/2025 07:21:02 AM (9 months ago)
Author:
nielslange
Message:

Update to version 3.5 from GitHub

Location:
smntcs-google-webmaster-tools
Files:
6 added
4 deleted
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • smntcs-google-webmaster-tools/tags/3.5/.prettierrc.js

    r3173459 r3265467  
    1111            },
    1212        },
     13        {
     14            files: '*.md',
     15            options: {
     16                tabWidth: 2,
     17                listItemIndent: 'one',
     18            },
     19        },
    1320    ],
    1421};
  • smntcs-google-webmaster-tools/tags/3.5/README.md

    r3215084 r3265467  
    17171. Upload `smntcs-google-webmaster-tools` to the `/wp-content/plugins/` directory
    18182. Activate the plugin through the _Plugins_ menu in WordPress
    19 3. Go to <https://search.google.com/search-console/welcome>
    20 4. Provide your URL in the section `URL prefix`, e.g. <https://example.com>, and click on `Continue`
     193. Go to [https://search.google.com/search-console/welcome](https://search.google.com/search-console/welcome).
     204. Provide your URL in the section `URL prefix`, e.g. [https://example.com](https://example.com), and click on `Continue`
    21215. Now, open the section `HTML tag` within the section `Other verification methods`
    22226. Copy the meta tag, e.g. `<meta name="google-site-verification" content="BeFze6w_rrIm1NFPKJ-pDDbkf0oeqrtC5sjqb6WzCoE" />`
     
    2525## Plugin page
    2626
    27 You can find the plugin on <https://wordpress.org/plugins/smntcs-google-webmaster-tools/>.
     27You can find the plugin on[WordPress.org](https://wordpress.org/plugins/smntcs-google-webmaster-tools/).
    2828
    2929## Changelog
    3030
     31### 3.5 (2025.04.02)
     32
     33- Test up to WordPress 6.8
     34
    3135### 3.4 (2024.10.30)
    3236
    33 -   Test up to WordPress 6.7
     37- Test up to WordPress 6.7
    3438
    3539### 3.3 (2024.10.22)
    3640
    37 -   Test up to WordPress 6.6
    38 -   Migrate Cypress to Playwright
     41- Test up to WordPress 6.6
     42- Migrate Cypress to Playwright
    3943
    4044### 3.2 (2023.10.02)
    4145
    42 -   Test up to WordPress 6.4
     46- Test up to WordPress 6.4
    4347
    4448### 3.1 (2023.03.11)
    4549
    46 -   Test up to WordPress 6.2
     50- Test up to WordPress 6.2
    4751
    4852### 3.0 (2022.12.03)
    4953
    50 -   Test up to WordPress 6.1
     54- Test up to WordPress 6.1
    5155
    5256### 2.9 (2022.05.09)
    5357
    54 -   Test up to WordPress 6.0
     58- Test up to WordPress 6.0
    5559
    5660### 2.8 (2021.12.19)
    5761
    58 -   [Replace Travis CI with GitHub Actions](https://github.com/nielslange/smntcs-google-webmaster-tools/issues/62)
    59 -   Test up to WordPress 5.8
     62- [Replace Travis CI with GitHub Actions](https://github.com/nielslange/smntcs-google-webmaster-tools/issues/62)
     63- Test up to WordPress 5.8
    6064
    6165### 2.7 (2021.04.25)
    6266
    63 -   Test up to WordPress 5.7
     67- Test up to WordPress 5.7
    6468
    6569### 2.6 (2020.10.09)
    6670
    67 -   Test up to WordPress 5.5
     71- Test up to WordPress 5.5
    6872
    6973### 2.5 (2020.05.02)
    7074
    71 -   [Add testing](https://github.com/nielslange/smntcs-google-webmaster-tools/issues/3)
    72 -   Test up to WordPress 5.4
     75- [Add testing](https://github.com/nielslange/smntcs-google-webmaster-tools/issues/3)
     76- Test up to WordPress 5.4
    7377
    7478### 2.4 (2019.11.22)
    7579
    76 -   Test up to WordPress 5.3
     80- Test up to WordPress 5.3
    7781
    7882### 2.3 (2019.06.28)
    7983
    80 -   Update installation instructions
     84- Update installation instructions
    8185
    8286### 2.2 (2018.03.18)
    8387
    84 -   Add README.md
     88- Add README.md
    8589
    8690### 2.1 (2016.12.24)
    8791
    88 -   Add FAQ
     92- Add FAQ
    8993
    9094### 2.0 (2016.09.11)
    9195
    92 -   Use Customizer instead of options page
     96- Use Customizer instead of options page
    9397
    9498### 1.6 (2016.07.20)
    9599
    96 -   Add donation link
     100- Add donation link
    97101
    98102### 1.5 (2016.07.20)
    99103
    100 -   Update textdomain
     104- Update textdomain
    101105
    102106### 1.4 (2016.07.20)
    103107
    104 -   Add settings link
    105 -   Update Dutch translation
    106 -   Update German translation
     108- Add settings link
     109- Update Dutch translation
     110- Update German translation
    107111
    108112### 1.3 (2016.07.20)
    109113
    110 -   Store translations outside plugin
     114- Store translations outside plugin
    111115
    112116### 1.2 (2016.07.20)
    113117
    114 -   Make plugin translation ready
    115 -   Add Dutch translation
    116 -   Add German translation
     118- Make plugin translation ready
     119- Add Dutch translation
     120- Add German translation
    117121
    118122### 1.1 (2016.07.20)
    119123
    120 -   Fix broken file path
    121 -   Add FAQs
     124- Fix broken file path
     125- Add FAQs
    122126
    123127### 1.0 (2016.07.20)
    124128
    125 -   Initial release
     129- Initial release
  • smntcs-google-webmaster-tools/tags/3.5/README.txt

    r3215084 r3265467  
    33Contributors:       nielslange
    44Tags:               Google Webmaster Tools, Google Search Console
    5 Stable tag:         3.4
    6 Tested up to:       6.7
    7 Requires PHP:       5.6
     5Stable tag:         3.5
     6Tested up to:       6.8
     7Requires PHP:       7.4
    88Requires at least:  3.4
    99License:            GPL v2 or later
     
    5151
    5252== Changelog ==
     53
     54= 3.5 (2025.04.02) =
     55
     56-   Test up to WordPress 6.8
    5357
    5458= 3.4 (2024.10.30) =
  • smntcs-google-webmaster-tools/tags/3.5/composer.json

    r3173459 r3265467  
    33    "description": "Adds the verification code of Google Search Console, former Google Webmaster Tools, to your site.",
    44    "homepage": "https://github.com/nielslange/smntcs-google-webmaster-tools",
    5     "support": {
    6         "issues": "https://github.com/nielslange/smntcs-google-webmaster-tools/issues",
    7         "source": "https://github.com/nielslange/smntcs-google-webmaster-tools"
    8     },
    95    "type": "wordpress-plugin",
    106    "keywords": [
     
    2016        }
    2117    ],
    22     "require": {
    23         "php": ">=8.2"
    24     },
    2518    "require-dev": {
    2619        "dealerdirect/phpcodesniffer-composer-installer": "1.0.0",
     
    3326    },
    3427    "scripts": {
    35         "phpcbf": "phpcbf --standard=phpcs.dist.xml .",
    36         "phpcs": "phpcs --standard=phpcs.dist.xml .",
     28        "phpcbf": "phpcbf --standard=phpcs.xml .",
     29        "phpcs": "phpcs --standard=phpcs.xml .",
    3730        "phplint": "phplint",
    3831        "psalm": "psalm --no-cache"
  • smntcs-google-webmaster-tools/tags/3.5/package.json

    r3215084 r3265467  
    1010    ],
    1111    "homepage": "https://github.com/nielslange/smntcs-google-webmaster-tools#readme",
    12     "repository": {
    13         "type": "git",
    14         "url": "git+https://github.com/nielslange/smntcs-google-webmaster-tools.git"
    15     },
    16     "bugs": {
    17         "url": "https://github.com/nielslange/smntcs-google-webmaster-tools/issues"
    18     },
    1912    "devDependencies": {
    2013        "@playwright/test": "1.48.1",
     
    3023        "phplint": "composer phplint",
    3124        "psalm": "composer psalm --no-cache",
    32         "test": "npm-run-all --parallel phpcs phplint psalm test:e2e",
     25        "test": "npm-run-all --parallel phpcs phplint psalm",
    3326        "test:e2e": "npx playwright test",
    3427        "test:e2e-dev": "npx playwright test --ui",
    3528        "wp-env": "wp-env",
    36         "wp-env:rc": "wp-env run cli sh -c 'wp core update --version=6.7-RC1 && wp core update --version=6.7-RC1 --force'"
     29        "wp-env:rc": "wp-env run cli sh -c 'wp core update --version=6.8-RC1 && wp core update --version=6.8-RC1 --force'"
    3730    }
    3831}
  • smntcs-google-webmaster-tools/tags/3.5/smntcs-google-webmaster-tools.php

    r3215084 r3265467  
    77 * Author URI:            https://nielslange.de
    88 * Text Domain:           smntcs-google-webmaster-tools
    9  * Version:               3.4
    10  * Requires PHP:          5.6
     9 * Version:               3.5
     10 * Requires PHP:          7.4
    1111 * Requires at least:     5.5
    1212 * License:               GPL v2 or later
     
    1616 */
    1717
     18declare( strict_types=1 );
    1819defined( 'ABSPATH' ) || exit;
    1920
    20 /**
    21  * Class SMNTCS_Google_Webmaster_Tools
    22  */
    23 class SMNTCS_Google_Webmaster_Tools {
     21// Define constants.
     22define( 'SMNTCS_GOOGLE_WEBMASTER_TOOLS_PLUGIN_FILE', __FILE__ );
    2423
    25     /**
    26      * SMNTCS_Google_Webmaster_Tools constructor.
    27      */
    28     public function __construct() {
    29         add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'plugin_settings_link' ) );
    30         add_action( 'customize_register', array( $this, 'register_customize' ) );
    31         add_action( 'wp_head', array( $this, 'enqueue' ), 10, 0 );
    32     }
    33 
    34     /**
    35      * Add settings link to plugin list.
    36      *
    37      * @param array $links Array of plugin action links.
    38      * @return array
    39      */
    40     public function plugin_settings_link( $links ) {
    41         $admin_url     = admin_url( 'customize.php?autofocus[control]=smntcs_google_webmaster_tools_tracking_code' );
    42         $settings_link = '<a href="' . esc_url( $admin_url ) . '">' . __( 'Settings', 'smntcs-google-webmaster-tools' ) . '</a>';
    43         array_unshift( $links, $settings_link );
    44 
    45         return $links;
    46     }
    47 
    48     /**
    49      * Register customizer settings.
    50      *
    51      * @param WP_Customize_Manager $wp_customize Customizer instance.
    52      * @return void
    53      */
    54     public function register_customize( $wp_customize ) {
    55         $wp_customize->add_section(
    56             'smntcs_google_webmaster_tools_section',
    57             array(
    58                 'priority' => 150,
    59                 'title'    => __( 'Google Search Console', 'smntcs-google-webmaster-tools' ),
    60             )
    61         );
    62 
    63         $wp_customize->add_setting(
    64             'smntcs_google_webmaster_tools_tracking_code',
    65             array(
    66                 'type' => 'option',
    67             )
    68         );
    69 
    70         $wp_customize->add_control(
    71             'smntcs_google_webmaster_tools_tracking_code',
    72             array(
    73                 'label'   => __( 'Verification code', 'smntcs-google-webmaster-tools' ),
    74                 'section' => 'smntcs_google_webmaster_tools_section',
    75                 'type'    => 'textarea',
    76             )
    77         );
    78     }
    79 
    80     /**
    81      * Output the tracking code in the head section.
    82      *
    83      * @return void
    84      */
    85     public function enqueue() {
    86         $tracking_code = get_option( 'smntcs_google_webmaster_tools_tracking_code' );
    87         if ( $tracking_code ) {
    88             echo $tracking_code . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    89         }
    90     }
    91 }
    92 
    93 new SMNTCS_Google_Webmaster_Tools();
     24// Load plugin classes.
     25require_once plugin_dir_path( SMNTCS_GOOGLE_WEBMASTER_TOOLS_PLUGIN_FILE ) . '/includes/class-smntcs-google-webmaster-tools.php';
  • smntcs-google-webmaster-tools/trunk/.prettierrc.js

    r3173459 r3265467  
    1111            },
    1212        },
     13        {
     14            files: '*.md',
     15            options: {
     16                tabWidth: 2,
     17                listItemIndent: 'one',
     18            },
     19        },
    1320    ],
    1421};
  • smntcs-google-webmaster-tools/trunk/README.md

    r3215084 r3265467  
    17171. Upload `smntcs-google-webmaster-tools` to the `/wp-content/plugins/` directory
    18182. Activate the plugin through the _Plugins_ menu in WordPress
    19 3. Go to <https://search.google.com/search-console/welcome>
    20 4. Provide your URL in the section `URL prefix`, e.g. <https://example.com>, and click on `Continue`
     193. Go to [https://search.google.com/search-console/welcome](https://search.google.com/search-console/welcome).
     204. Provide your URL in the section `URL prefix`, e.g. [https://example.com](https://example.com), and click on `Continue`
    21215. Now, open the section `HTML tag` within the section `Other verification methods`
    22226. Copy the meta tag, e.g. `<meta name="google-site-verification" content="BeFze6w_rrIm1NFPKJ-pDDbkf0oeqrtC5sjqb6WzCoE" />`
     
    2525## Plugin page
    2626
    27 You can find the plugin on <https://wordpress.org/plugins/smntcs-google-webmaster-tools/>.
     27You can find the plugin on[WordPress.org](https://wordpress.org/plugins/smntcs-google-webmaster-tools/).
    2828
    2929## Changelog
    3030
     31### 3.5 (2025.04.02)
     32
     33- Test up to WordPress 6.8
     34
    3135### 3.4 (2024.10.30)
    3236
    33 -   Test up to WordPress 6.7
     37- Test up to WordPress 6.7
    3438
    3539### 3.3 (2024.10.22)
    3640
    37 -   Test up to WordPress 6.6
    38 -   Migrate Cypress to Playwright
     41- Test up to WordPress 6.6
     42- Migrate Cypress to Playwright
    3943
    4044### 3.2 (2023.10.02)
    4145
    42 -   Test up to WordPress 6.4
     46- Test up to WordPress 6.4
    4347
    4448### 3.1 (2023.03.11)
    4549
    46 -   Test up to WordPress 6.2
     50- Test up to WordPress 6.2
    4751
    4852### 3.0 (2022.12.03)
    4953
    50 -   Test up to WordPress 6.1
     54- Test up to WordPress 6.1
    5155
    5256### 2.9 (2022.05.09)
    5357
    54 -   Test up to WordPress 6.0
     58- Test up to WordPress 6.0
    5559
    5660### 2.8 (2021.12.19)
    5761
    58 -   [Replace Travis CI with GitHub Actions](https://github.com/nielslange/smntcs-google-webmaster-tools/issues/62)
    59 -   Test up to WordPress 5.8
     62- [Replace Travis CI with GitHub Actions](https://github.com/nielslange/smntcs-google-webmaster-tools/issues/62)
     63- Test up to WordPress 5.8
    6064
    6165### 2.7 (2021.04.25)
    6266
    63 -   Test up to WordPress 5.7
     67- Test up to WordPress 5.7
    6468
    6569### 2.6 (2020.10.09)
    6670
    67 -   Test up to WordPress 5.5
     71- Test up to WordPress 5.5
    6872
    6973### 2.5 (2020.05.02)
    7074
    71 -   [Add testing](https://github.com/nielslange/smntcs-google-webmaster-tools/issues/3)
    72 -   Test up to WordPress 5.4
     75- [Add testing](https://github.com/nielslange/smntcs-google-webmaster-tools/issues/3)
     76- Test up to WordPress 5.4
    7377
    7478### 2.4 (2019.11.22)
    7579
    76 -   Test up to WordPress 5.3
     80- Test up to WordPress 5.3
    7781
    7882### 2.3 (2019.06.28)
    7983
    80 -   Update installation instructions
     84- Update installation instructions
    8185
    8286### 2.2 (2018.03.18)
    8387
    84 -   Add README.md
     88- Add README.md
    8589
    8690### 2.1 (2016.12.24)
    8791
    88 -   Add FAQ
     92- Add FAQ
    8993
    9094### 2.0 (2016.09.11)
    9195
    92 -   Use Customizer instead of options page
     96- Use Customizer instead of options page
    9397
    9498### 1.6 (2016.07.20)
    9599
    96 -   Add donation link
     100- Add donation link
    97101
    98102### 1.5 (2016.07.20)
    99103
    100 -   Update textdomain
     104- Update textdomain
    101105
    102106### 1.4 (2016.07.20)
    103107
    104 -   Add settings link
    105 -   Update Dutch translation
    106 -   Update German translation
     108- Add settings link
     109- Update Dutch translation
     110- Update German translation
    107111
    108112### 1.3 (2016.07.20)
    109113
    110 -   Store translations outside plugin
     114- Store translations outside plugin
    111115
    112116### 1.2 (2016.07.20)
    113117
    114 -   Make plugin translation ready
    115 -   Add Dutch translation
    116 -   Add German translation
     118- Make plugin translation ready
     119- Add Dutch translation
     120- Add German translation
    117121
    118122### 1.1 (2016.07.20)
    119123
    120 -   Fix broken file path
    121 -   Add FAQs
     124- Fix broken file path
     125- Add FAQs
    122126
    123127### 1.0 (2016.07.20)
    124128
    125 -   Initial release
     129- Initial release
  • smntcs-google-webmaster-tools/trunk/README.txt

    r3215084 r3265467  
    33Contributors:       nielslange
    44Tags:               Google Webmaster Tools, Google Search Console
    5 Stable tag:         3.4
    6 Tested up to:       6.7
    7 Requires PHP:       5.6
     5Stable tag:         3.5
     6Tested up to:       6.8
     7Requires PHP:       7.4
    88Requires at least:  3.4
    99License:            GPL v2 or later
     
    5151
    5252== Changelog ==
     53
     54= 3.5 (2025.04.02) =
     55
     56-   Test up to WordPress 6.8
    5357
    5458= 3.4 (2024.10.30) =
  • smntcs-google-webmaster-tools/trunk/composer.json

    r3173459 r3265467  
    33    "description": "Adds the verification code of Google Search Console, former Google Webmaster Tools, to your site.",
    44    "homepage": "https://github.com/nielslange/smntcs-google-webmaster-tools",
    5     "support": {
    6         "issues": "https://github.com/nielslange/smntcs-google-webmaster-tools/issues",
    7         "source": "https://github.com/nielslange/smntcs-google-webmaster-tools"
    8     },
    95    "type": "wordpress-plugin",
    106    "keywords": [
     
    2016        }
    2117    ],
    22     "require": {
    23         "php": ">=8.2"
    24     },
    2518    "require-dev": {
    2619        "dealerdirect/phpcodesniffer-composer-installer": "1.0.0",
     
    3326    },
    3427    "scripts": {
    35         "phpcbf": "phpcbf --standard=phpcs.dist.xml .",
    36         "phpcs": "phpcs --standard=phpcs.dist.xml .",
     28        "phpcbf": "phpcbf --standard=phpcs.xml .",
     29        "phpcs": "phpcs --standard=phpcs.xml .",
    3730        "phplint": "phplint",
    3831        "psalm": "psalm --no-cache"
  • smntcs-google-webmaster-tools/trunk/package.json

    r3215084 r3265467  
    1010    ],
    1111    "homepage": "https://github.com/nielslange/smntcs-google-webmaster-tools#readme",
    12     "repository": {
    13         "type": "git",
    14         "url": "git+https://github.com/nielslange/smntcs-google-webmaster-tools.git"
    15     },
    16     "bugs": {
    17         "url": "https://github.com/nielslange/smntcs-google-webmaster-tools/issues"
    18     },
    1912    "devDependencies": {
    2013        "@playwright/test": "1.48.1",
     
    3023        "phplint": "composer phplint",
    3124        "psalm": "composer psalm --no-cache",
    32         "test": "npm-run-all --parallel phpcs phplint psalm test:e2e",
     25        "test": "npm-run-all --parallel phpcs phplint psalm",
    3326        "test:e2e": "npx playwright test",
    3427        "test:e2e-dev": "npx playwright test --ui",
    3528        "wp-env": "wp-env",
    36         "wp-env:rc": "wp-env run cli sh -c 'wp core update --version=6.7-RC1 && wp core update --version=6.7-RC1 --force'"
     29        "wp-env:rc": "wp-env run cli sh -c 'wp core update --version=6.8-RC1 && wp core update --version=6.8-RC1 --force'"
    3730    }
    3831}
  • smntcs-google-webmaster-tools/trunk/smntcs-google-webmaster-tools.php

    r3215084 r3265467  
    77 * Author URI:            https://nielslange.de
    88 * Text Domain:           smntcs-google-webmaster-tools
    9  * Version:               3.4
    10  * Requires PHP:          5.6
     9 * Version:               3.5
     10 * Requires PHP:          7.4
    1111 * Requires at least:     5.5
    1212 * License:               GPL v2 or later
     
    1616 */
    1717
     18declare( strict_types=1 );
    1819defined( 'ABSPATH' ) || exit;
    1920
    20 /**
    21  * Class SMNTCS_Google_Webmaster_Tools
    22  */
    23 class SMNTCS_Google_Webmaster_Tools {
     21// Define constants.
     22define( 'SMNTCS_GOOGLE_WEBMASTER_TOOLS_PLUGIN_FILE', __FILE__ );
    2423
    25     /**
    26      * SMNTCS_Google_Webmaster_Tools constructor.
    27      */
    28     public function __construct() {
    29         add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'plugin_settings_link' ) );
    30         add_action( 'customize_register', array( $this, 'register_customize' ) );
    31         add_action( 'wp_head', array( $this, 'enqueue' ), 10, 0 );
    32     }
    33 
    34     /**
    35      * Add settings link to plugin list.
    36      *
    37      * @param array $links Array of plugin action links.
    38      * @return array
    39      */
    40     public function plugin_settings_link( $links ) {
    41         $admin_url     = admin_url( 'customize.php?autofocus[control]=smntcs_google_webmaster_tools_tracking_code' );
    42         $settings_link = '<a href="' . esc_url( $admin_url ) . '">' . __( 'Settings', 'smntcs-google-webmaster-tools' ) . '</a>';
    43         array_unshift( $links, $settings_link );
    44 
    45         return $links;
    46     }
    47 
    48     /**
    49      * Register customizer settings.
    50      *
    51      * @param WP_Customize_Manager $wp_customize Customizer instance.
    52      * @return void
    53      */
    54     public function register_customize( $wp_customize ) {
    55         $wp_customize->add_section(
    56             'smntcs_google_webmaster_tools_section',
    57             array(
    58                 'priority' => 150,
    59                 'title'    => __( 'Google Search Console', 'smntcs-google-webmaster-tools' ),
    60             )
    61         );
    62 
    63         $wp_customize->add_setting(
    64             'smntcs_google_webmaster_tools_tracking_code',
    65             array(
    66                 'type' => 'option',
    67             )
    68         );
    69 
    70         $wp_customize->add_control(
    71             'smntcs_google_webmaster_tools_tracking_code',
    72             array(
    73                 'label'   => __( 'Verification code', 'smntcs-google-webmaster-tools' ),
    74                 'section' => 'smntcs_google_webmaster_tools_section',
    75                 'type'    => 'textarea',
    76             )
    77         );
    78     }
    79 
    80     /**
    81      * Output the tracking code in the head section.
    82      *
    83      * @return void
    84      */
    85     public function enqueue() {
    86         $tracking_code = get_option( 'smntcs_google_webmaster_tools_tracking_code' );
    87         if ( $tracking_code ) {
    88             echo $tracking_code . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    89         }
    90     }
    91 }
    92 
    93 new SMNTCS_Google_Webmaster_Tools();
     24// Load plugin classes.
     25require_once plugin_dir_path( SMNTCS_GOOGLE_WEBMASTER_TOOLS_PLUGIN_FILE ) . '/includes/class-smntcs-google-webmaster-tools.php';
Note: See TracChangeset for help on using the changeset viewer.