84% switch-cta-box

Code Review | Switch CTA Box

WordPress plugin Switch CTA Box scored84%from 54 tests.

About plugin

  • Plugin page: switch-cta-box
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-5.2.2
  • WordPress version: 6.3.1
  • First release: Apr 19, 2017
  • Latest release: Jul 25, 2019
  • Number of updates: 10
  • Update frequency: every 82.7 days
  • Top authors: wpshouter (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

50+ active /1,390 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼6.79ms] Passed 4 tests

An overview of server-side resources used by Switch CTA Box
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0937.12 ▼8.15
Dashboard /wp-admin3.38 ▲0.0851.72 ▼0.23
Posts /wp-admin/edit.php3.43 ▲0.0873.08 ▲21.90
Add New Post /wp-admin/post-new.php5.97 ▲0.0890.95 ▼17.83
Media Library /wp-admin/upload.php3.31 ▲0.0838.13 ▼0.93
Add New /wp-admin/post-new.php?post_type=ctabox3.3548.04
All CTA Box /wp-admin/edit.php?post_type=ctabox3.3540.47

Server storage [IO: ▲1.05MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Please fix the following
  • Illegal file modification detected: 1 file (4.00KB) outside of "wp-content/plugins/switch-cta-box/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Switch CTA Box: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲8813.36 ▼1.021.94 ▲0.1740.76 ▼5.51
Dashboard /wp-admin2,250 ▲445.76 ▲0.8897.92 ▼7.8639.13 ▼7.73
Posts /wp-admin/edit.php2,132 ▲322.05 ▲0.0239.78 ▼3.3035.48 ▼1.62
Add New Post /wp-admin/post-new.php1,565 ▲2023.17 ▼0.06670.00 ▼0.5656.00 ▲3.77
Media Library /wp-admin/upload.php1,429 ▲294.23 ▲0.0199.15 ▼4.5544.13 ▼3.23
Add New /wp-admin/post-new.php?post_type=ctabox1,8912.7753.2958.71
All CTA Box /wp-admin/edit.php?post_type=ctabox1,0932.1231.8731.07

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/switch-cta-box/inc/post_type_meta_feilds.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/switch-cta-box/inc/box_display_template.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/switch-cta-box/inc/post_type.php:65
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/switch-cta-box/inc/shortcode_setup.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/switch-cta-box/inc/box_display_orng_template.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/switch-cta-box/inc/admin/admin_enuqe.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/switch-cta-box/inc/admin/admin_modify.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/switch-cta-box/inc/box_display_wid_template.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: call to action, promotion, add management, advertising, contents...

switch-cta-box/wp-ss-box.php 92% from 13 tests

"Switch CTA Box" version 1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("switch-cta-box.php" instead of "wp-ss-box.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin524 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP97156282
CSS33523212
JavaScript10230

PHP code Passed 2 tests

A short review 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.19
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%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.19MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
psd/psd-tem-cta-box-3.PNG31.66KB11.87KB▼ 62.50%
psd/psd-tem-cta-box-1.png33.78KB12.16KB▼ 64.00%
inc/admin/preview/template_2.png31.80KB9.87KB▼ 68.96%
psd/psd-widtem-cta-box-2.png31.80KB9.87KB▼ 68.96%
inc/admin/preview/template_1.png33.78KB12.16KB▼ 64.00%