94% tomahk-shortcodes

Code Review | Toma.hk Shortcodes

WordPress plugin Toma.hk Shortcodes scored 94% from 54 tests.

About plugin

  • Plugin page: tomahk-shortcodes
  • Plugin version: 0.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.5.1
  • WordPress version: 5.8.1
  • First release: Apr 23, 2013
  • Latest release: Apr 24, 2013
  • Number of updates: 8
  • Update frequency: every 0.3 days
  • Top authors: grosbouff (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 600 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.00MB] [CPU: ▼180.88ms] Passed 4 tests

Analyzing server-side resources used by Toma.hk Shortcodes
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0024.20 ▲3.07
Dashboard /wp-admin3.06 ▼0.0030.14 ▼8.46
Posts /wp-admin/edit.php3.12 ▲0.0131.23 ▼0.48
Add New Post /wp-admin/post-new.php5.43 ▼0.0169.39 ▼715.85
Media Library /wp-admin/upload.php3.01 ▲0.0022.72 ▲1.27

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Toma.hk Shortcodes
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,666 ▲6516.00 ▲0.374.95 ▼0.5976.88 ▲1.70
Dashboard /wp-admin2,933 ▲406.10 ▼0.07116.91 ▼15.78163.60 ▼6.06
Posts /wp-admin/edit.php2,740 ▲33.22 ▼0.0263.13 ▼2.42134.38 ▼1.98
Add New Post /wp-admin/post-new.php3,735 ▼7220.96 ▲1.90455.08 ▼15.61159.89 ▼6.09
Media Library /wp-admin/upload.php1,749 ▼35.51 ▼0.03144.62 ▼0.07186.17 ▼1.61

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

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 everything seems fine, this is not an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/tomahk-shortcodes/tomahk-shortcodes.php:53

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side


Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
8 plugin tags: tomahk, spotify, exfm, grooveshark, shortcode...

tomahk-shortcodes/tomahk-shortcodes.php Passed 13 tests

The main file in "Toma.hk Shortcodes" v. 0.1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
73 characters long description:
Use shortcodes to embed playlists, albums and single tracks from toma.hk.

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
No dangerous file extensions were detected262 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity11.75
▷ Minimum class complexity4.00
▷ Maximum class complexity17.00
Average method complexity3.26
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
▷ Static methods15.26%
▷ Public methods1894.74%
▷ Protected methods00.00%
▷ Private methods15.26%
▷ Named functions1100.00%
▷ Anonymous functions00.00%
▷ Global constants00.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
No PNG files were detected