79% thron

Code Review | THRON

WordPress plugin THRON scored79%from 54 tests.

About plugin

  • Plugin page: thron
  • Plugin version: 1.3.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.1
  • WordPress version: 6.3.1
  • First release: May 14, 2020
  • Latest release: Aug 2, 2023
  • Number of updates: 26
  • Update frequency: every 45.5 days
  • Top authors: thronspa (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,066 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.40MB] [CPU: ▼11.27ms] Passed 4 tests

An overview of server-side resources used by THRON
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.23 ▲0.7734.90 ▼13.30
Dashboard /wp-admin4.57 ▲1.2660.41 ▲5.85
Posts /wp-admin/edit.php4.59 ▲1.2466.36 ▲18.87
Add New Post /wp-admin/post-new.php4.30 ▼1.5946.65 ▼47.19
Media Library /wp-admin/upload.php4.41 ▲1.1850.26 ▲9.58

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 405 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
thron_last_sync
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for THRON
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,078 ▲31716.16 ▲1.815.85 ▲4.0138.04 ▼6.48
Dashboard /wp-admin2,364 ▲1876.96 ▲1.37126.65 ▲36.2395.60 ▲50.47
Posts /wp-admin/edit.php2,320 ▲2233.79 ▲1.8365.59 ▲29.2380.51 ▲43.71
Add New Post /wp-admin/post-new.php1,580 ▲5423.59 ▲0.41714.64 ▲43.0838.85 ▼9.92
Media Library /wp-admin/upload.php1,449 ▲524.84 ▲0.6295.24 ▼6.1492.47 ▲45.78

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 14 options in the database
    • thron_token_id_time
    • thron_tracking_context
    • thron_pkey
    • thron_last_sync
    • widget_recent-comments
    • db_upgraded
    • thron_option_api_page
    • thron_token_id
    • widget_recent-posts
    • thron_playerTemplates
    • ...

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)
Good news, no errors were detected

SRP 0% 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 items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/thron/public/partials/player.php
  • 58× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Counter_Base' not found in wp-content/plugins/thron/includes/cmb2/includes/types/CMB2_Type_Textarea.php:13
    • > PHP Notice
      Undefined variable: scalemode in wp-content/plugins/thron/public/partials/player.php on line 45
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Select' not found in wp-content/plugins/thron/includes/cmb2/includes/types/CMB2_Type_Select_Timezone.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/thron/includes/cmb2/includes/types/CMB2_Type_Taxonomy_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/thron/includes/cmb2/includes/types/CMB2_Type_Text_Date.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller' not found in wp-content/plugins/thron/includes/cmb2/includes/rest-api/CMB2_REST_Controller_Boxes.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/thron/includes/cmb2/includes/types/CMB2_Type_Title.php:13
    • > PHP Notice
      Undefined variable: uniqID in wp-content/plugins/thron/public/partials/player.php on line 8
    • > PHP Notice
      Undefined variable: contentID in wp-content/plugins/thron/public/partials/player.php on line 39
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Counter_Base' not found in wp-content/plugins/thron/includes/cmb2/includes/types/CMB2_Type_Text.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
1 plugin tags: dam

thron/thron.php Passed 13 tests

The entry point to "THRON" version 1.3.1 is a PHP file that has certain tags in its header comment area
75 characters long description:
Select the assets to insert within your pages directly from the DAM library

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected58,354 lines of code in 251 files:
LanguageFilesBlank linesComment linesLines of code
PO File12114,35918,54932,438
PHP733,0197,24810,177
CSS163851,2895,180
JSON3004,375
JavaScript167617874,018
Sass17305291,407
Markdown32390735
SVG21224

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity20.45
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity3.52
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes80
▷ Abstract classes911.25%
▷ Concrete classes7188.75%
▷ Final classes00.00%
Methods620
▷ Static methods9114.68%
▷ Public methods51583.06%
▷ Protected methods8914.35%
▷ Private methods162.58%
Functions44
▷ Named functions4090.91%
▷ Anonymous functions49.09%
Constants13
▷ Global constants646.15%
▷ Class constants753.85%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
16 PNG files occupy 0.15MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/thumbnails-icons.png130.43KB27.73KB▼ 78.74%
includes/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
includes/cmb2/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
includes/cmb2/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
includes/cmb2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%