78% mcjh-button-shortcode

Code Review | mcjh button shortcode

WordPress plugin mcjh button shortcode scored78%from 54 tests.

About plugin

  • Plugin page: mcjh-button-short...
  • Plugin version: 1.6.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.0.3
  • WordPress version: 6.3.1
  • First release: Feb 20, 2015
  • Latest release: Jan 23, 2019
  • Number of updates: 34
  • Update frequency: every 42.1 days
  • Top authors: MarcusHartmann (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,720 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼3.37ms] Passed 4 tests

A check of server-side resources used by mcjh button shortcode
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1138.60 ▼8.85
Dashboard /wp-admin3.42 ▲0.1152.25 ▼1.19
Posts /wp-admin/edit.php3.53 ▲0.1747.94 ▼0.96
Add New Post /wp-admin/post-new.php6.02 ▲0.1395.31 ▼2.48
Media Library /wp-admin/upload.php3.34 ▲0.1138.64 ▲4.34

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 50 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by mcjh button shortcode
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲9613.22 ▼0.942.79 ▲1.0145.25 ▼2.12
Dashboard /wp-admin2,223 ▲325.88 ▼0.00112.13 ▲7.3242.77 ▼0.33
Posts /wp-admin/edit.php2,118 ▲262.08 ▲0.0839.21 ▼11.4536.47 ▲2.37
Add New Post /wp-admin/post-new.php1,540 ▲723.02 ▼0.22636.99 ▼2.9863.59 ▲3.80
Media Library /wp-admin/upload.php1,417 ▲324.26 ▲0.04104.09 ▼9.1145.50 ▼9.74

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/mcjh-button-shortcode/mcjh-cta-buttons.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mcjh-button-shortcode/inc/mcjh-cta-shortcode.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mcjh-button-shortcode/inc/mcjh-cta-script-loader.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mcjh-button-shortcode/inc/mcjh-cta-admin-page.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/mcjh-button-shortcode/inc/mcjh-cta-backend-ajax.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: Too many tags (19 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

mcjh-button-shortcode/mcjh-cta-buttons.php 85% from 13 tests

The primary PHP file in "mcjh button shortcode" version 1.6.4 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("mcjh-button-shortcode.php" instead of "mcjh-cta-buttons.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Good job! No executable or dangerous file extensions detected5,516 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript67966593,839
PHP711053838
CSS460545
HTML110183
PO File14692111

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity8.50
▷ Minimum class complexity1.00
▷ Maximum class complexity16.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods325.00%
▷ Protected methods00.00%
▷ Private methods975.00%
Functions15
▷ Named functions1493.33%
▷ Anonymous functions16.67%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
24 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/colorpicker/images/colorpicker_hsb_s.png1.14KB0.80KB▼ 29.97%
src/colorpicker/images/custom_rgb_b.png0.98KB0.74KB▼ 25.00%
src/colorpicker/images/custom_hsb_s.png1.14KB0.89KB▼ 21.75%
src/colorpicker/images/colorpicker_submit.png0.96KB1.04KB0.00%
src/colorpicker/images/custom_rgb_r.png0.99KB0.74KB▼ 25.34%