84% shortcodehub

Code Review | ShortcodeHub - MultiPurpose Shortcode Builder

WordPress plugin ShortcodeHub - MultiPurpose Shortcode Builder scored84%from 54 tests.

About plugin

  • Plugin page: shortcodehub
  • Plugin version: 1.7.1
  • PHP compatiblity: 5.5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.2.2
  • WordPress version: 6.3.1
  • First release: May 15, 2019
  • Latest release: Aug 8, 2023
  • Number of updates: 34
  • Update frequency: every 45.6 days
  • Top authors: surror (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,680 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲2.24MB] [CPU: ▲8.22ms] Passed 4 tests

Analyzing server-side resources used by ShortcodeHub - MultiPurpose Shortcode Builder
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /5.76 ▲2.2958.16 ▲21.25
Dashboard /wp-admin5.58 ▲2.2765.15 ▲9.77
Posts /wp-admin/edit.php5.63 ▲2.2761.97 ▲10.63
Add New Post /wp-admin/post-new.php8.12 ▲2.2397.24 ▼8.76
Media Library /wp-admin/upload.php5.44 ▲2.2054.71 ▲22.37
Add New /wp-admin/edit.php?post_type=shortcode&page=shortcode-add-new5.4250.54
All Shortcodes /wp-admin/edit.php?post_type=shortcode5.5449.04
Dashboard /wp-admin/edit.php?post_type=shortcode&page=shortcodehub5.4145.64
Categories /wp-admin/edit-tags.php?taxonomy=shortcode-category&post_type=shortcode5.4352.51

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 1,136 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
sh_first_activation
db_upgraded
can_compress_scripts
sh-auto-version
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for ShortcodeHub - MultiPurpose Shortcode Builder
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,959 ▲19814.25 ▼0.101.83 ▲0.2839.30 ▼0.72
Dashboard /wp-admin2,341 ▲1615.70 ▲0.0288.49 ▼1.1586.97 ▲42.02
Posts /wp-admin/edit.php2,144 ▲442.03 ▼0.0033.81 ▼4.3734.28 ▲0.45
Add New Post /wp-admin/post-new.php1,560 ▲3423.10 ▼0.18676.10 ▲8.5964.23 ▲14.44
Media Library /wp-admin/upload.php1,441 ▲444.18 ▼0.0193.56 ▼10.5938.92 ▼7.55
Add New /wp-admin/edit.php?post_type=shortcode&page=shortcode-add-new1,1322.0626.3734.99
All Shortcodes /wp-admin/edit.php?post_type=shortcode1,1652.3940.3528.53
Dashboard /wp-admin/edit.php?post_type=shortcode&page=shortcodehub9702.0123.4850.03
Categories /wp-admin/edit-tags.php?taxonomy=shortcode-category&post_type=shortcode1,3152.1227.2232.39

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • sh-auto-version
    • can_compress_scripts
    • sh_first_activation
    • db_upgraded
    • 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 | This is a shallow check for 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
Please take a closer look at the following
  • 397× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Name' not found in wp-content/plugins/shortcodehub/inc/classes/timber-library/vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Filter' not found in wp-content/plugins/shortcodehub/inc/classes/timber-library/vendor/twig/twig/lib/Twig/Filter/Function.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_TokenParserBrokerInterface' not found in wp-content/plugins/shortcodehub/inc/classes/timber-library/vendor/twig/twig/lib/Twig/TokenParserBroker.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/shortcodehub/inc/classes/timber-library/vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/shortcodehub/inc/classes/types/query/post/timeline/class-sh-shortcode-type-query-timeline.php:46
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Filter' not found in wp-content/plugins/shortcodehub/inc/classes/timber-library/vendor/twig/twig/lib/Twig/Filter/Method.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression' not found in wp-content/plugins/shortcodehub/inc/classes/timber-library/vendor/twig/twig/lib/Twig/Node/Expression/Call.php:11
    • > PHP Fatal error
      require_once(): Failed opening required 'SHORTCODEHUB_DIRinc/classes/types/class-sh-shortcode-type-text-editor.php' (include_path='.:/usr/share/php') in wp-content/plugins/shortcodehub/inc/classes/class-sh-shortcode.php on line 46
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/shortcodehub/inc/classes/timber-library/vendor/composer/installers/src/Composer/Installers/ChefInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/shortcodehub/inc/includes/getting-started.php:12

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 97% 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:
  • Screenshots: No descriptions were found for these screenshots #6, #7, #8, #9 in shortcodehub/assets to your readme.txt
You can look at the official readme.txt

shortcodehub/shortcodehub.php Passed 13 tests

"ShortcodeHub - MultiPurpose Shortcode Builder" version 1.7.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
98 characters long description:
Unleash the Power of Shortcodes with the Ultimate All-in-One Multi-Purpose Shortcode Builder! 🚀

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin48,851 lines of code in 837 files:
LanguageFilesBlank linesComment linesLines of code
PHP6517,22714,79531,121
JavaScript212,4395868,166
CSS26411784,047
reStructuredText892,4142,1313,370
C1172184859
JSON600620
Markdown31200299
Twig22560162
Bourne Shell122686
XML36071
HTML110017
C/C++ Header171315
SVG11013
m41215

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity5.54
▷ Minimum class complexity1.00
▷ Maximum class complexity172.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces37
Interfaces47
Traits0
Classes639
▷ Abstract classes182.82%
▷ Concrete classes62197.18%
▷ Final classes40.64%
Methods2,359
▷ Static methods2249.50%
▷ Public methods2,06187.37%
▷ Protected methods25810.94%
▷ Private methods401.70%
Functions154
▷ Named functions10668.83%
▷ Anonymous functions4831.17%
Constants68
▷ Global constants811.76%
▷ Class constants6088.24%
▷ Public constants60100.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
4 PNG files occupy 0.16MB with 0.09MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/assets/images/show-shortcode.png47.78KB20.02KB▼ 58.09%
inc/assets/images/show-hooks.png47.44KB14.34KB▼ 69.77%
inc/assets/images/select-shortcode-type.png59.46KB21.19KB▼ 64.37%
inc/assets/images/logo.png5.12KB2.72KB▼ 46.82%