84% google-campaign-text-replacer

Code Review | Google Campaign Text Replacer

WordPress plugin Google Campaign Text Replacer scored84%from 54 tests.

About plugin

  • Plugin page: google-campaign-t...
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-3.8.1
  • WordPress version: 6.3.1
  • First release: Dec 17, 2013
  • Latest release: Feb 22, 2014
  • Number of updates: 5
  • Update frequency: every 13.4 days
  • Top authors: BrashRebel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /807 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.94ms] Passed 4 tests

An overview of server-side resources used by Google Campaign Text Replacer
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0142.96 ▼2.30
Dashboard /wp-admin3.32 ▼0.0260.86 ▼5.78
Posts /wp-admin/edit.php3.37 ▲0.0150.10 ▼4.71
Add New Post /wp-admin/post-new.php5.90 ▲0.0188.68 ▼18.97
Media Library /wp-admin/upload.php3.24 ▲0.0136.51 ▲0.07
Campaign Text /wp-admin/options-general.php?page=google-campaign-text-replacer3.2131.86

Server storage [IO: ▲0.01MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Google Campaign Text Replacer
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.75 ▼0.011.89 ▼0.1444.95 ▲0.26
Dashboard /wp-admin2,196 ▲225.60 ▼0.0794.56 ▼4.3239.60 ▼3.51
Posts /wp-admin/edit.php2,104 ▲42.00 ▼0.0034.39 ▼0.4934.48 ▼2.94
Add New Post /wp-admin/post-new.php1,529 ▲317.60 ▲0.11610.72 ▼64.0361.90 ▲10.31
Media Library /wp-admin/upload.php1,404 ▲44.24 ▼0.0598.94 ▼13.9245.44 ▼6.10
Campaign Text /wp-admin/options-general.php?page=google-campaign-text-replacer9882.1722.9232.62

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/google-campaign-text-replacer/admin/admin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/google-campaign-text-replacer/shortcodes.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/google-campaign-text-replacer/admin/admin.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: seo, ppc, google adwords, google, keywords...

google-campaign-text-replacer/gctr.php 92% from 13 tests

"Google Campaign Text Replacer" version 2.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("google-campaign-text-replacer.php" instead of "gctr.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected163 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP3718130
JavaScript10133

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.03
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected