68% dynamic-shortcode-ajax

Code Review | Dynamic Shortcode

WordPress plugin Dynamic Shortcode scored68%from 54 tests.

About plugin

  • Plugin page: dynamic-shortcode...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.6
  • WordPress version: 6.3.1
  • First release: Jan 8, 2021
  • Latest release: Jan 8, 2021
  • Number of updates: 7
  • Update frequency: every 0.1 days
  • Top authors: humanai (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /488 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.35MB] [CPU: ▼2.33ms] Passed 4 tests

Server-side resources used by Dynamic Shortcode
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.3442.01 ▼0.75
Dashboard /wp-admin3.65 ▲0.3547.41 ▲1.36
Posts /wp-admin/edit.php3.77 ▲0.4150.10 ▼3.56
Add New Post /wp-admin/post-new.php6.25 ▲0.3787.10 ▼6.37
Media Library /wp-admin/upload.php3.58 ▲0.3543.03 ▲9.99
Keep It Alive /wp-admin/admin.php?page=dynamic-shortcode-donate3.5433.55
Placeholders /wp-admin/admin.php?page=dynamic-shortcode-placeholders3.5434.67
Global Settings /wp-admin/admin.php?page=dynamic-shortcode-globalsettings3.5433.76
Help /wp-admin/admin.php?page=dynamic-shortcode-help3.5430.38
Shortcodes /wp-admin/admin.php?page=dynamic-shortcode-shortcodes3.5432.87
Notice /wp-admin/admin.php?page=dynamic-shortcode-notice3.5431.15

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 32 new files
Database: 4 new tables, 6 new options
New tables
wp_dynamic_shortcode_globalsettings
wp_dynamic_shortcode_placeholders
wp_dynamic_shortcode
wp_dynamic_shortcode_settings
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Dynamic Shortcode: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,950 ▲19313.73 ▼0.561.82 ▼0.3228.41 ▼23.45
Dashboard /wp-admin2,332 ▲1415.44 ▲0.53120.01 ▲15.7788.40 ▲45.27
Posts /wp-admin/edit.php2,242 ▲1502.76 ▲0.7540.25 ▼5.7385.11 ▲46.88
Add New Post /wp-admin/post-new.php1,731 ▲21221.10 ▼2.14827.34 ▲117.8541.03 ▼18.61
Media Library /wp-admin/upload.php1,481 ▲934.81 ▲0.52117.40 ▲3.6481.65 ▲35.61
Keep It Alive /wp-admin/admin.php?page=dynamic-shortcode-donate1,0212.2030.4547.27
Placeholders /wp-admin/admin.php?page=dynamic-shortcode-placeholders1,0712.5028.7849.28
Global Settings /wp-admin/admin.php?page=dynamic-shortcode-globalsettings1,2032.4529.2840.70
Help /wp-admin/admin.php?page=dynamic-shortcode-help1,0222.2029.8238.07
Shortcodes /wp-admin/admin.php?page=dynamic-shortcode-shortcodes1,1722.2227.9448.13
Notice /wp-admin/admin.php?page=dynamic-shortcode-notice9952.1930.2238.10

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie tables detected upon uninstall: 4 tables
    • wp_dynamic_shortcode
    • wp_dynamic_shortcode_settings
    • wp_dynamic_shortcode_globalsettings
    • wp_dynamic_shortcode_placeholders
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dynamic-shortcode-ajax/AdminDashboard.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dynamic-shortcode-ajax/Hooks.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/dynamic-shortcode-ajax/index.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dynamic-shortcode-ajax/Dynamic.php:79
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dynamic-shortcode-ajax/DynamicReplace.php:8

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=dynamic-shortcode-donate
    • > Network (severe)
    https://www.paypalobjects.com/en_CA/i/scr/pixel.gif - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Requires php: Version not formatted correctly
The official readme.txt is a good inspiration

dynamic-shortcode-ajax/index.php 92% from 13 tests

This is the main PHP file of "Dynamic Shortcode" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("dynamic-shortcode-ajax.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected16,331 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
CSS81,32679,961
JavaScript6245213,506
PHP126851212,864

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
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%
Functions89
▷ Named functions89100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There were not PNG files found in your plugin