Changeset 3265467
- Timestamp:
- 04/02/2025 07:21:02 AM (9 months ago)
- Location:
- smntcs-google-webmaster-tools
- Files:
-
- 6 added
- 4 deleted
- 12 edited
- 1 copied
-
tags/3.5 (copied) (copied from smntcs-google-webmaster-tools/trunk)
-
tags/3.5/.prettierrc.js (modified) (1 diff)
-
tags/3.5/README.md (modified) (2 diffs)
-
tags/3.5/README.txt (modified) (2 diffs)
-
tags/3.5/composer.json (modified) (3 diffs)
-
tags/3.5/includes (added)
-
tags/3.5/includes/class-smntcs-google-webmaster-tools.php (added)
-
tags/3.5/languages (deleted)
-
tags/3.5/package.json (modified) (2 diffs)
-
tags/3.5/phpcs.dist.xml (deleted)
-
tags/3.5/phpcs.xml (added)
-
tags/3.5/smntcs-google-webmaster-tools.php (modified) (2 diffs)
-
trunk/.prettierrc.js (modified) (1 diff)
-
trunk/README.md (modified) (2 diffs)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/composer.json (modified) (3 diffs)
-
trunk/includes (added)
-
trunk/includes/class-smntcs-google-webmaster-tools.php (added)
-
trunk/languages (deleted)
-
trunk/package.json (modified) (2 diffs)
-
trunk/phpcs.dist.xml (deleted)
-
trunk/phpcs.xml (added)
-
trunk/smntcs-google-webmaster-tools.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
smntcs-google-webmaster-tools/tags/3.5/.prettierrc.js
r3173459 r3265467 11 11 }, 12 12 }, 13 { 14 files: '*.md', 15 options: { 16 tabWidth: 2, 17 listItemIndent: 'one', 18 }, 19 }, 13 20 ], 14 21 }; -
smntcs-google-webmaster-tools/tags/3.5/README.md
r3215084 r3265467 17 17 1. Upload `smntcs-google-webmaster-tools` to the `/wp-content/plugins/` directory 18 18 2. 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`19 3. Go to [https://search.google.com/search-console/welcome](https://search.google.com/search-console/welcome). 20 4. Provide your URL in the section `URL prefix`, e.g. [https://example.com](https://example.com), and click on `Continue` 21 21 5. Now, open the section `HTML tag` within the section `Other verification methods` 22 22 6. Copy the meta tag, e.g. `<meta name="google-site-verification" content="BeFze6w_rrIm1NFPKJ-pDDbkf0oeqrtC5sjqb6WzCoE" />` … … 25 25 ## Plugin page 26 26 27 You can find the plugin on <https://wordpress.org/plugins/smntcs-google-webmaster-tools/>.27 You can find the plugin on[WordPress.org](https://wordpress.org/plugins/smntcs-google-webmaster-tools/). 28 28 29 29 ## Changelog 30 30 31 ### 3.5 (2025.04.02) 32 33 - Test up to WordPress 6.8 34 31 35 ### 3.4 (2024.10.30) 32 36 33 - Test up to WordPress 6.737 - Test up to WordPress 6.7 34 38 35 39 ### 3.3 (2024.10.22) 36 40 37 - Test up to WordPress 6.638 - Migrate Cypress to Playwright41 - Test up to WordPress 6.6 42 - Migrate Cypress to Playwright 39 43 40 44 ### 3.2 (2023.10.02) 41 45 42 - Test up to WordPress 6.446 - Test up to WordPress 6.4 43 47 44 48 ### 3.1 (2023.03.11) 45 49 46 - Test up to WordPress 6.250 - Test up to WordPress 6.2 47 51 48 52 ### 3.0 (2022.12.03) 49 53 50 - Test up to WordPress 6.154 - Test up to WordPress 6.1 51 55 52 56 ### 2.9 (2022.05.09) 53 57 54 - Test up to WordPress 6.058 - Test up to WordPress 6.0 55 59 56 60 ### 2.8 (2021.12.19) 57 61 58 - [Replace Travis CI with GitHub Actions](https://github.com/nielslange/smntcs-google-webmaster-tools/issues/62)59 - Test up to WordPress 5.862 - [Replace Travis CI with GitHub Actions](https://github.com/nielslange/smntcs-google-webmaster-tools/issues/62) 63 - Test up to WordPress 5.8 60 64 61 65 ### 2.7 (2021.04.25) 62 66 63 - Test up to WordPress 5.767 - Test up to WordPress 5.7 64 68 65 69 ### 2.6 (2020.10.09) 66 70 67 - Test up to WordPress 5.571 - Test up to WordPress 5.5 68 72 69 73 ### 2.5 (2020.05.02) 70 74 71 - [Add testing](https://github.com/nielslange/smntcs-google-webmaster-tools/issues/3)72 - Test up to WordPress 5.475 - [Add testing](https://github.com/nielslange/smntcs-google-webmaster-tools/issues/3) 76 - Test up to WordPress 5.4 73 77 74 78 ### 2.4 (2019.11.22) 75 79 76 - Test up to WordPress 5.380 - Test up to WordPress 5.3 77 81 78 82 ### 2.3 (2019.06.28) 79 83 80 - Update installation instructions84 - Update installation instructions 81 85 82 86 ### 2.2 (2018.03.18) 83 87 84 - Add README.md88 - Add README.md 85 89 86 90 ### 2.1 (2016.12.24) 87 91 88 - Add FAQ92 - Add FAQ 89 93 90 94 ### 2.0 (2016.09.11) 91 95 92 - Use Customizer instead of options page96 - Use Customizer instead of options page 93 97 94 98 ### 1.6 (2016.07.20) 95 99 96 - Add donation link100 - Add donation link 97 101 98 102 ### 1.5 (2016.07.20) 99 103 100 - Update textdomain104 - Update textdomain 101 105 102 106 ### 1.4 (2016.07.20) 103 107 104 - Add settings link105 - Update Dutch translation106 - Update German translation108 - Add settings link 109 - Update Dutch translation 110 - Update German translation 107 111 108 112 ### 1.3 (2016.07.20) 109 113 110 - Store translations outside plugin114 - Store translations outside plugin 111 115 112 116 ### 1.2 (2016.07.20) 113 117 114 - Make plugin translation ready115 - Add Dutch translation116 - Add German translation118 - Make plugin translation ready 119 - Add Dutch translation 120 - Add German translation 117 121 118 122 ### 1.1 (2016.07.20) 119 123 120 - Fix broken file path121 - Add FAQs124 - Fix broken file path 125 - Add FAQs 122 126 123 127 ### 1.0 (2016.07.20) 124 128 125 - Initial release129 - Initial release -
smntcs-google-webmaster-tools/tags/3.5/README.txt
r3215084 r3265467 3 3 Contributors: nielslange 4 4 Tags: Google Webmaster Tools, Google Search Console 5 Stable tag: 3. 46 Tested up to: 6. 77 Requires PHP: 5.65 Stable tag: 3.5 6 Tested up to: 6.8 7 Requires PHP: 7.4 8 8 Requires at least: 3.4 9 9 License: GPL v2 or later … … 51 51 52 52 == Changelog == 53 54 = 3.5 (2025.04.02) = 55 56 - Test up to WordPress 6.8 53 57 54 58 = 3.4 (2024.10.30) = -
smntcs-google-webmaster-tools/tags/3.5/composer.json
r3173459 r3265467 3 3 "description": "Adds the verification code of Google Search Console, former Google Webmaster Tools, to your site.", 4 4 "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 },9 5 "type": "wordpress-plugin", 10 6 "keywords": [ … … 20 16 } 21 17 ], 22 "require": {23 "php": ">=8.2"24 },25 18 "require-dev": { 26 19 "dealerdirect/phpcodesniffer-composer-installer": "1.0.0", … … 33 26 }, 34 27 "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 .", 37 30 "phplint": "phplint", 38 31 "psalm": "psalm --no-cache" -
smntcs-google-webmaster-tools/tags/3.5/package.json
r3215084 r3265467 10 10 ], 11 11 "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 },19 12 "devDependencies": { 20 13 "@playwright/test": "1.48.1", … … 30 23 "phplint": "composer phplint", 31 24 "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", 33 26 "test:e2e": "npx playwright test", 34 27 "test:e2e-dev": "npx playwright test --ui", 35 28 "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'" 37 30 } 38 31 } -
smntcs-google-webmaster-tools/tags/3.5/smntcs-google-webmaster-tools.php
r3215084 r3265467 7 7 * Author URI: https://nielslange.de 8 8 * Text Domain: smntcs-google-webmaster-tools 9 * Version: 3. 410 * Requires PHP: 5.69 * Version: 3.5 10 * Requires PHP: 7.4 11 11 * Requires at least: 5.5 12 12 * License: GPL v2 or later … … 16 16 */ 17 17 18 declare( strict_types=1 ); 18 19 defined( 'ABSPATH' ) || exit; 19 20 20 /** 21 * Class SMNTCS_Google_Webmaster_Tools 22 */ 23 class SMNTCS_Google_Webmaster_Tools { 21 // Define constants. 22 define( 'SMNTCS_GOOGLE_WEBMASTER_TOOLS_PLUGIN_FILE', __FILE__ ); 24 23 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. 25 require_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 11 11 }, 12 12 }, 13 { 14 files: '*.md', 15 options: { 16 tabWidth: 2, 17 listItemIndent: 'one', 18 }, 19 }, 13 20 ], 14 21 }; -
smntcs-google-webmaster-tools/trunk/README.md
r3215084 r3265467 17 17 1. Upload `smntcs-google-webmaster-tools` to the `/wp-content/plugins/` directory 18 18 2. 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`19 3. Go to [https://search.google.com/search-console/welcome](https://search.google.com/search-console/welcome). 20 4. Provide your URL in the section `URL prefix`, e.g. [https://example.com](https://example.com), and click on `Continue` 21 21 5. Now, open the section `HTML tag` within the section `Other verification methods` 22 22 6. Copy the meta tag, e.g. `<meta name="google-site-verification" content="BeFze6w_rrIm1NFPKJ-pDDbkf0oeqrtC5sjqb6WzCoE" />` … … 25 25 ## Plugin page 26 26 27 You can find the plugin on <https://wordpress.org/plugins/smntcs-google-webmaster-tools/>.27 You can find the plugin on[WordPress.org](https://wordpress.org/plugins/smntcs-google-webmaster-tools/). 28 28 29 29 ## Changelog 30 30 31 ### 3.5 (2025.04.02) 32 33 - Test up to WordPress 6.8 34 31 35 ### 3.4 (2024.10.30) 32 36 33 - Test up to WordPress 6.737 - Test up to WordPress 6.7 34 38 35 39 ### 3.3 (2024.10.22) 36 40 37 - Test up to WordPress 6.638 - Migrate Cypress to Playwright41 - Test up to WordPress 6.6 42 - Migrate Cypress to Playwright 39 43 40 44 ### 3.2 (2023.10.02) 41 45 42 - Test up to WordPress 6.446 - Test up to WordPress 6.4 43 47 44 48 ### 3.1 (2023.03.11) 45 49 46 - Test up to WordPress 6.250 - Test up to WordPress 6.2 47 51 48 52 ### 3.0 (2022.12.03) 49 53 50 - Test up to WordPress 6.154 - Test up to WordPress 6.1 51 55 52 56 ### 2.9 (2022.05.09) 53 57 54 - Test up to WordPress 6.058 - Test up to WordPress 6.0 55 59 56 60 ### 2.8 (2021.12.19) 57 61 58 - [Replace Travis CI with GitHub Actions](https://github.com/nielslange/smntcs-google-webmaster-tools/issues/62)59 - Test up to WordPress 5.862 - [Replace Travis CI with GitHub Actions](https://github.com/nielslange/smntcs-google-webmaster-tools/issues/62) 63 - Test up to WordPress 5.8 60 64 61 65 ### 2.7 (2021.04.25) 62 66 63 - Test up to WordPress 5.767 - Test up to WordPress 5.7 64 68 65 69 ### 2.6 (2020.10.09) 66 70 67 - Test up to WordPress 5.571 - Test up to WordPress 5.5 68 72 69 73 ### 2.5 (2020.05.02) 70 74 71 - [Add testing](https://github.com/nielslange/smntcs-google-webmaster-tools/issues/3)72 - Test up to WordPress 5.475 - [Add testing](https://github.com/nielslange/smntcs-google-webmaster-tools/issues/3) 76 - Test up to WordPress 5.4 73 77 74 78 ### 2.4 (2019.11.22) 75 79 76 - Test up to WordPress 5.380 - Test up to WordPress 5.3 77 81 78 82 ### 2.3 (2019.06.28) 79 83 80 - Update installation instructions84 - Update installation instructions 81 85 82 86 ### 2.2 (2018.03.18) 83 87 84 - Add README.md88 - Add README.md 85 89 86 90 ### 2.1 (2016.12.24) 87 91 88 - Add FAQ92 - Add FAQ 89 93 90 94 ### 2.0 (2016.09.11) 91 95 92 - Use Customizer instead of options page96 - Use Customizer instead of options page 93 97 94 98 ### 1.6 (2016.07.20) 95 99 96 - Add donation link100 - Add donation link 97 101 98 102 ### 1.5 (2016.07.20) 99 103 100 - Update textdomain104 - Update textdomain 101 105 102 106 ### 1.4 (2016.07.20) 103 107 104 - Add settings link105 - Update Dutch translation106 - Update German translation108 - Add settings link 109 - Update Dutch translation 110 - Update German translation 107 111 108 112 ### 1.3 (2016.07.20) 109 113 110 - Store translations outside plugin114 - Store translations outside plugin 111 115 112 116 ### 1.2 (2016.07.20) 113 117 114 - Make plugin translation ready115 - Add Dutch translation116 - Add German translation118 - Make plugin translation ready 119 - Add Dutch translation 120 - Add German translation 117 121 118 122 ### 1.1 (2016.07.20) 119 123 120 - Fix broken file path121 - Add FAQs124 - Fix broken file path 125 - Add FAQs 122 126 123 127 ### 1.0 (2016.07.20) 124 128 125 - Initial release129 - Initial release -
smntcs-google-webmaster-tools/trunk/README.txt
r3215084 r3265467 3 3 Contributors: nielslange 4 4 Tags: Google Webmaster Tools, Google Search Console 5 Stable tag: 3. 46 Tested up to: 6. 77 Requires PHP: 5.65 Stable tag: 3.5 6 Tested up to: 6.8 7 Requires PHP: 7.4 8 8 Requires at least: 3.4 9 9 License: GPL v2 or later … … 51 51 52 52 == Changelog == 53 54 = 3.5 (2025.04.02) = 55 56 - Test up to WordPress 6.8 53 57 54 58 = 3.4 (2024.10.30) = -
smntcs-google-webmaster-tools/trunk/composer.json
r3173459 r3265467 3 3 "description": "Adds the verification code of Google Search Console, former Google Webmaster Tools, to your site.", 4 4 "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 },9 5 "type": "wordpress-plugin", 10 6 "keywords": [ … … 20 16 } 21 17 ], 22 "require": {23 "php": ">=8.2"24 },25 18 "require-dev": { 26 19 "dealerdirect/phpcodesniffer-composer-installer": "1.0.0", … … 33 26 }, 34 27 "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 .", 37 30 "phplint": "phplint", 38 31 "psalm": "psalm --no-cache" -
smntcs-google-webmaster-tools/trunk/package.json
r3215084 r3265467 10 10 ], 11 11 "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 },19 12 "devDependencies": { 20 13 "@playwright/test": "1.48.1", … … 30 23 "phplint": "composer phplint", 31 24 "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", 33 26 "test:e2e": "npx playwright test", 34 27 "test:e2e-dev": "npx playwright test --ui", 35 28 "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'" 37 30 } 38 31 } -
smntcs-google-webmaster-tools/trunk/smntcs-google-webmaster-tools.php
r3215084 r3265467 7 7 * Author URI: https://nielslange.de 8 8 * Text Domain: smntcs-google-webmaster-tools 9 * Version: 3. 410 * Requires PHP: 5.69 * Version: 3.5 10 * Requires PHP: 7.4 11 11 * Requires at least: 5.5 12 12 * License: GPL v2 or later … … 16 16 */ 17 17 18 declare( strict_types=1 ); 18 19 defined( 'ABSPATH' ) || exit; 19 20 20 /** 21 * Class SMNTCS_Google_Webmaster_Tools 22 */ 23 class SMNTCS_Google_Webmaster_Tools { 21 // Define constants. 22 define( 'SMNTCS_GOOGLE_WEBMASTER_TOOLS_PLUGIN_FILE', __FILE__ ); 24 23 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. 25 require_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.