78% personalized-shortcode-pro

Code Review | Personalized Shortcodes Pro

WordPress plugin Personalized Shortcodes Pro scored78%from 54 tests.

About plugin

  • Plugin page: personalized-shor...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-5.2.2
  • WordPress version: 6.3.1
  • First release: Jul 2, 2019
  • Latest release: Jul 6, 2019
  • Number of updates: 5
  • Update frequency: every 0.8 days
  • Top authors: poglaa (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /611 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.36MB] [CPU: ▼2.29ms] Passed 4 tests

A check of server-side resources used by Personalized Shortcodes Pro
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.4043.12 ▲3.57
Dashboard /wp-admin3.70 ▲0.4048.62 ▼3.24
Posts /wp-admin/edit.php3.75 ▲0.3954.78 ▼1.11
Add New Post /wp-admin/post-new.php6.22 ▲0.3397.87 ▼8.38
Media Library /wp-admin/upload.php3.56 ▲0.3342.29 ▲5.21
Personalized Shortcode /wp-admin/options-general.php?page=psp-settings3.5338.06

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 100 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Personalized Shortcodes Pro
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,877 ▲11613.40 ▼1.228.13 ▲6.4040.89 ▼3.51
Dashboard /wp-admin2,196 ▲195.64 ▲0.0492.31 ▼5.8541.63 ▼1.86
Posts /wp-admin/edit.php2,101 ▼22.00 ▲0.0339.62 ▲2.5137.75 ▼1.48
Add New Post /wp-admin/post-new.php1,541 ▲1523.15 ▼0.35672.96 ▼15.3657.12 ▲6.00
Media Library /wp-admin/upload.php1,407 ▲104.14 ▼0.04108.85 ▼3.4943.94 ▼4.72
Personalized Shortcode /wp-admin/options-general.php?page=psp-settings8342.0226.2329.60

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/personalized-shortcode-pro/vendor/mustangostang/spyc/examples/yaml-load.php
    • > /wp-content/plugins/personalized-shortcode-pro/vendor/mustangostang/spyc/php4/5to4.php
  • 31× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/personalized-shortcode-pro/vendor/mustangostang/spyc/tests/LoadTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'DeviceDetector\\Parser\\Device\\DeviceParserAbstract' not found in wp-content/plugins/personalized-shortcode-pro/vendor/piwik/device-detector/Parser/Device/Mobile.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'DeviceDetector\\Parser\\Client\\ClientParserAbstract' not found in wp-content/plugins/personalized-shortcode-pro/vendor/piwik/device-detector/Parser/Client/Library.php:17
    • > PHP Warning
      file_get_contents(../spyc.php): failed to open stream: No such file or directory in wp-content/plugins/personalized-shortcode-pro/vendor/mustangostang/spyc/php4/5to4.php on line 6
    • > PHP Fatal error
      Uncaught Error: Interface 'DeviceDetector\\Cache\\Cache' not found in wp-content/plugins/personalized-shortcode-pro/vendor/piwik/device-detector/Cache/StaticCache.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'DeviceDetector\\Parser\\Client\\ClientParserAbstract' not found in wp-content/plugins/personalized-shortcode-pro/vendor/piwik/device-detector/Parser/Client/Browser.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'DeviceDetector\\Cache\\Cache' not found in wp-content/plugins/personalized-shortcode-pro/vendor/piwik/device-detector/Cache/PSR16Bridge.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'DeviceDetector\\Parser\\ParserAbstract' not found in wp-content/plugins/personalized-shortcode-pro/vendor/piwik/device-detector/Parser/Device/DeviceParserAbstract.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'DeviceDetector\\Parser\\Device\\DeviceParserAbstract' not found in wp-content/plugins/personalized-shortcode-pro/vendor/piwik/device-detector/Parser/Device/Console.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'DeviceDetector\\Yaml\\Parser' not found in wp-content/plugins/personalized-shortcode-pro/vendor/piwik/device-detector/Yaml/Symfony.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (Plugin Settings), #2 (How to use in admin), #3 (Display on frontend)
The official readme.txt might help

personalized-shortcode-pro/personalized-shortcode-pro.php Passed 13 tests

"Personalized Shortcodes Pro" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
55 characters long description:
Plugin enables you to use data from user in shortcodes.

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
Good job! No executable or dangerous file extensions detected16,393 lines of code in 87 files:
LanguageFilesBlank linesComment linesLines of code
YAML211,29084310,945
PHP581,1972,3635,006
JSON400193
Markdown31000185
JavaScript120164

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity14.04
▷ Minimum class complexity1.00
▷ Maximum class complexity257.00
Average method complexity2.56
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces9
Interfaces2
Traits0
Classes43
▷ Abstract classes49.30%
▷ Concrete classes3990.70%
▷ Final classes00.00%
Methods384
▷ Static methods389.90%
▷ Public methods30579.43%
▷ Protected methods246.25%
▷ Private methods5514.32%
Functions14
▷ Named functions1285.71%
▷ Anonymous functions214.29%
Constants26
▷ Global constants726.92%
▷ Class constants1973.08%
▷ Public constants19100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin