84% theme-junkie-shortcodes

Code Review | TJ Shortcodes

WordPress plugin TJ Shortcodes scored 84% from 54 tests.

About plugin

  • Plugin page: theme-junkie-shor...
  • Plugin version: 0.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1
  • WordPress version: 6.3.1
  • First release: May 29, 2014
  • Latest release: Oct 26, 2022
  • Number of updates: 16
  • Update frequency: every 192.1 days
  • Top authors: themejunkie (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

3,000+ active / 62,977 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.01MB] [CPU: ▲0.25ms] Passed 4 tests

A check of server-side resources used by TJ Shortcodes
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.43 ▲2.17
Dashboard /wp-admin3.32 ▲0.0149.12 ▲2.78
Posts /wp-admin/edit.php3.37 ▲0.0145.68 ▲1.27
Add New Post /wp-admin/post-new.php5.90 ▲0.0181.56 ▼1.28
Media Library /wp-admin/upload.php3.24 ▲0.0134.87 ▼1.14

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for TJ Shortcodes
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,915 ▲12613.73 ▼1.017.85 ▲5.9543.01 ▲3.38
Dashboard /wp-admin2,203 ▼35.83 ▲0.9797.01 ▲1.8539.94 ▲1.77
Posts /wp-admin/edit.php2,089 ▼02.02 ▼0.0139.38 ▲6.5037.09 ▲4.41
Add New Post /wp-admin/post-new.php2,301 ▲78717.85 ▲0.28659.45 ▲3.5245.38 ▼14.99
Media Library /wp-admin/upload.php1,382 ▼64.19 ▲0.03100.25 ▼20.6044.37 ▼2.60

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • 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 no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/theme-junkie-shortcodes/shortcodes/dropcap.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/theme-junkie-shortcodes/inc/class-junkie-editor-shortcodes.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/theme-junkie-shortcodes/shortcodes/alert.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/theme-junkie-shortcodes/inc/config.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/theme-junkie-shortcodes/shortcodes/hightlights.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/theme-junkie-shortcodes/shortcodes/column.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/theme-junkie-shortcodes/shortcodes/tab.php:46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/theme-junkie-shortcodes/shortcodes/button.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/theme-junkie-shortcodes/shortcodes/toggle.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (Shortcodes button) image missing
You can take inspiration from this readme.txt

theme-junkie-shortcodes/tj-shortcodes.php 92% from 13 tests

This is the main PHP file of "TJ Shortcodes" version 0.1.3, 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:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("theme-junkie-shortcodes.php" instead of "tj-shortcodes.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected960 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP10156238570
CSS27020373
JavaScript15017

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity10.50
▷ Minimum class complexity2.00
▷ Maximum class complexity19.00
Average method complexity2.90
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 compressed PNG files occupy 0.01MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png13.28KB13.12KB▼ 1.18%
assets/img/toggle-open.png0.10KB0.12KB0.00%
assets/img/toggle-closed.png0.10KB0.12KB0.00%