10% my-shortcodes

Code Review | My Shortcodes

WordPress plugin My Shortcodes scored10%from 54 tests.

About plugin

  • Plugin page: my-shortcodes
  • Plugin version: 2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.6
  • WordPress version: 6.3.1
  • First release: May 8, 2012
  • Latest release: Jul 16, 2014
  • Number of updates: 63
  • Update frequency: every 28.5 days
  • Top authors: Desertsnowman (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

1,000+ active /28,635 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/my-shortcodes/libs/widget.php+4
    Methods with the same name as their class will not be constructors in a future version of PHP; msc_widget has a deprecated constructor

Server metrics [RAM: ▼1.08MB] [CPU: ▼44.86ms] Passed 4 tests

Analyzing server-side resources used by My Shortcodes
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.91 ▼0.558.66 ▼27.90
Dashboard /wp-admin2.93 ▼0.379.44 ▼37.13
Posts /wp-admin/edit.php2.93 ▼0.4212.79 ▼32.92
Add New Post /wp-admin/post-new.php2.93 ▼2.9610.16 ▼81.50
Media Library /wp-admin/upload.php2.93 ▼0.3010.57 ▼22.26

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 105 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_ceelements
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for My Shortcodes
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲4914.33 ▼0.401.57 ▼0.1041.31 ▼3.31
Dashboard /wp-admin2,219 ▲445.57 ▼0.0890.61 ▼17.5836.31 ▼1.52
Posts /wp-admin/edit.php2,121 ▲242.03 ▲0.0337.44 ▼2.8839.10 ▼0.97
Add New Post /wp-admin/post-new.php1,553 ▲2518.20 ▼4.75613.76 ▼27.0475.58 ▲6.74
Media Library /wp-admin/upload.php1,424 ▲304.09 ▼0.04102.36 ▼0.1941.62 ▼3.88

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/my-shortcodes/libs/widget.php+4
    Methods with the same name as their class will not be constructors in a future version of PHP; msc_widget has a deprecated constructor
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_ceelements
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

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)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 8× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/my-shortcodes/libs/libraries.php
    • > /wp-content/plugins/my-shortcodes/libs/preview.php
    • > /wp-content/plugins/my-shortcodes/libs/php.php
    • > /wp-content/plugins/my-shortcodes/libs/template.php
    • > /wp-content/plugins/my-shortcodes/libs/variables.php
    • > /wp-content/plugins/my-shortcodes/libs/assets.php
    • > /wp-content/plugins/my-shortcodes/libs/css.php
    • > /wp-content/plugins/my-shortcodes/libs/javascript.php
  • 17× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/my-shortcodes/libs/alwaysload.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/my-shortcodes/libs/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function msc_detectRogues() in wp-content/plugins/my-shortcodes/admin.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function stripslashes_deep() in wp-content/plugins/my-shortcodes/libs/editorpreview.php:18
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/my-shortcodes/admin.php on line 19
    • > PHP Warning
      Use of undefined constant MYSHORTCODES_VER - assumed 'MYSHORTCODES_VER' (this will throw an Error in a future version of PHP) in wp-content/plugins/my-shortcodes/admin.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/my-shortcodes/libs/actions.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/my-shortcodes/libs/widget.php:4
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/my-shortcodes/admin.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/my-shortcodes/plugincore.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% 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 to be fixed:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
  • Screenshots: These screenshots require images: #1 (You admin panel. Manage, edit, activate & export elements and shortcodes.), #2 (View a summary of your element for easy reference.), #3 (Element settings - with live preview.), #4 (Add external and WordPress provided librries for CSS and Javascript.), #5 (Clean editor with custom syntax hightlighting on built in tags like [loop] and [if] and your attriburtes in {{att}} tags.), #6 (Create dedicated widgets, with custom config panels for your attributes.)
You can take inspiration from this readme.txt

my-shortcodes/plugincore.php 85% from 13 tests

The primary PHP file in "My Shortcodes" version 2.3 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("my-shortcodes.php" instead of "plugincore.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 164 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected17,716 lines of code in 70 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript239057408,059
PHP238222125,038
CSS142151313,397
HTML911211,142
Markdown132080

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity32.67
▷ Minimum class complexity1.00
▷ Maximum class complexity74.00
Average method complexity9.64
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods11
▷ Static methods19.09%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions55
▷ Named functions55100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
33 PNG files occupy 1.12MB with 0.73MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png219.20KB76.00KB▼ 65.33%
editorcss/img/caldera-icon-assets.png1.43KB0.67KB▼ 52.93%
screenshot-6.png131.71KB32.97KB▼ 74.97%
editorcss/img/old-caldera-icon-edit.png4.84KB2.78KB▼ 42.48%
editorcss/img/caldera-icon-edit.png1.30KB0.12KB▼ 91.05%