84% ah-shortcodes

Code Review | AH Shortcodes

WordPress plugin AH Shortcodes scored84%from 54 tests.

About plugin

  • Plugin page: ah-shortcodes
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Nov 6, 2017
  • Latest release: Nov 7, 2017
  • Number of updates: 20
  • Update frequency: every 0.3 days
  • Top authors: AHecht (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,119 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.10MB] [CPU: ▼2.80ms] Passed 4 tests

Analyzing server-side resources used by AH Shortcodes
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0539.96 ▼0.22
Dashboard /wp-admin3.44 ▲0.1452.13 ▼1.22
Posts /wp-admin/edit.php3.53 ▲0.1750.75 ▼0.26
Add New Post /wp-admin/post-new.php5.97 ▲0.0885.96 ▼9.48
Media Library /wp-admin/upload.php3.36 ▲0.1338.75 ▲5.45

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for AH Shortcodes
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,917 ▲15613.53 ▼0.849.86 ▲8.0340.96 ▼2.50
Dashboard /wp-admin2,197 ▲205.47 ▼0.1784.00 ▼3.5439.45 ▼2.40
Posts /wp-admin/edit.php2,106 ▲32.07 ▲0.0636.01 ▼7.4532.66 ▼5.05
Add New Post /wp-admin/post-new.php2,206 ▲67818.20 ▼4.89681.73 ▲32.4174.75 ▲5.86
Media Library /wp-admin/upload.php1,402 ▲24.12 ▼0.0997.00 ▼14.2243.82 ▼5.02

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

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
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/ah-shortcodes/includes/shortcodes.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ah-shortcodes/ah-shortcodes.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ah-shortcodes/includes/config.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Requires at least: The plugin version is formatted incorrectly
You can take inspiration from this readme.txt

ah-shortcodes/ah-shortcodes.php 92% from 13 tests

This is the main PHP file of "AH Shortcodes" version 1.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin1,102 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP4250309646
CSS25614259
PO File17778180
JavaScript15017

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity12.00
▷ Minimum class complexity4.00
▷ Maximum class complexity20.00
Average method complexity4.14
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions29
▷ Named functions29100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/toggle-closed.png0.10KB0.12KB0.00%
assets/img/toggle-open.png0.10KB0.12KB0.00%