68% content-hubs

Code Review | Content Hubs

WordPress plugin Content Hubs scored68%from 54 tests.

About plugin

  • Plugin page: content-hubs
  • Plugin version: 1.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.0
  • WordPress version: 6.3.1
  • First release: Feb 3, 2022
  • Latest release: Sep 15, 2022
  • Number of updates: 9
  • Update frequency: every 25.1 days
  • Top authors: wildstylenetwork (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /721 total downloads

Benchmarks

Plugin footprint 65% from 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: ▲4.71MB] [CPU: ▲27.30ms] Passed 4 tests

Server-side resources used by Content Hubs
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /8.49 ▲5.0374.23 ▲29.87
Dashboard /wp-admin8.51 ▲5.2176.45 ▲23.53
Posts /wp-admin/edit.php8.51 ▲5.1675.01 ▲26.39
Add New Post /wp-admin/post-new.php9.31 ▲3.43126.48 ▲29.41
Media Library /wp-admin/upload.php8.51 ▲5.2876.45 ▲37.72
Freemius Debug [v.2.4.5] /wp-admin/admin.php?page=freemius8.5164.65

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 217 new files
Database: no new tables, 10 new options
New WordPress options
fs_active_plugins
db_upgraded
fs_debug_mode
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
fs_accounts
widget_recent-comments
fs_gdpr

Browser metrics Passed 4 tests

A check of browser resources used by Content Hubs
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,001 ▲25515.34 ▲0.691.89 ▼0.0535.88 ▼7.38
Dashboard /wp-admin2,407 ▲2196.68 ▲1.81116.68 ▲9.8137.76 ▼0.08
Posts /wp-admin/edit.php2,313 ▲2243.65 ▲1.6154.18 ▲11.3034.96 ▲0.11
Add New Post /wp-admin/post-new.php6,467 ▲4,94427.91 ▲4.84831.64 ▲208.5938.83 ▼9.25
Media Library /wp-admin/upload.php1,449 ▲614.27 ▲0.0784.55 ▼19.0946.38 ▲0.09
Freemius Debug [v.2.4.5] /wp-admin/admin.php?page=freemius1,2773.3141.9427.69

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/content-hubs/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 10 options
    • can_compress_scripts
    • fs_accounts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • fs_active_plugins
    • fs_debug_mode
    • db_upgraded
    • fs_gdpr

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
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
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/content-hubs/content-hubs.php
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined variable: ch in wp-content/plugins/content-hubs/templates/block-content-hub.php on line 4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/content-hubs/templates/edit_chps-content-hub.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'CHPS_Includes\\Base\\BaseController' not found in wp-content/plugins/content-hubs/inc/Base/Enqueue.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'CHPS_Includes\\Base\\BaseController' not found in wp-content/plugins/content-hubs/inc/Pages/Frontend.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'CHPS_Includes\\Base\\BaseController' not found in wp-content/plugins/content-hubs/inc/Base/PostController.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'CHPS_Includes\\Base\\BaseController' not found in wp-content/plugins/content-hubs/inc/Base/ContentHubController.php:10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/content-hubs/templates/block-content-hub.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'CHPS_Includes\\Base\\BaseController' not found in wp-content/plugins/content-hubs/inc/Base/BlockController.php:10
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/content-hubs/templates/block-content-hub.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
There were not plugin tags detected

content-hubs/content-hubs.php Passed 13 tests

"Content Hubs" version 1.0.8's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
37 characters long description:
Show multiple posts teaser in a grid.

Code Analysis 97% from 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
There were no executable files found in this plugin49,242 lines of code in 162 files:
LanguageFilesBlank linesComment linesLines of code
PHP1307,59416,63131,847
JSON50016,231
JavaScript9112182443
Sass3577361
CSS15538360

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 2,911)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity73.43
▷ Minimum class complexity1.00
▷ Maximum class complexity2,911.00
Average method complexity4.59
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes58
▷ Abstract classes23.45%
▷ Concrete classes5696.55%
▷ Final classes11.79%
Methods1,203
▷ Static methods20416.96%
▷ Public methods86071.49%
▷ Protected methods151.25%
▷ Private methods32827.27%
Functions100
▷ Named functions9898.00%
▷ Anonymous functions22.00%
Constants123
▷ Global constants9879.67%
▷ Class constants2520.33%
▷ Public constants25100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.60MB with 0.31MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
assets/images/chps_logo.png15.81KB6.08KB▼ 61.51%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
blocks/content-hub-block/build/images/bg_black.ea598ab1.png280.32KB132.29KB▼ 52.81%
assets/images/bg_black.png280.32KB132.29KB▼ 52.81%