84% socialhero-promotions

Code Review | Socialhero Promotions

WordPress plugin Socialhero Promotions scored84%from 54 tests.

About plugin

  • Plugin page: socialhero-promot...
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.2
  • WordPress version: 6.3.1
  • First release: Dec 26, 2022
  • Latest release: Jun 29, 2023
  • Number of updates: 23
  • Update frequency: every 8.6 days
  • Top authors: proficientdev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /310 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.00MB] [CPU: ▼3.40ms] Passed 4 tests

Server-side resources used by Socialhero Promotions
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.76 ▼8.59
Dashboard /wp-admin3.31 ▲0.0049.72 ▼0.05
Posts /wp-admin/edit.php3.36 ▲0.0049.00 ▼0.70
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.63 ▼3.46
Media Library /wp-admin/upload.php3.23 ▲0.0034.01 ▼0.83

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Socialhero Promotions
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.24 ▼0.352.03 ▲0.2542.99 ▼2.97
Dashboard /wp-admin2,195 ▲155.54 ▼0.1386.23 ▼6.2941.50 ▼1.42
Posts /wp-admin/edit.php2,097 ▼62.05 ▲0.0435.97 ▼9.9032.79 ▼5.87
Add New Post /wp-admin/post-new.php1,550 ▲1923.04 ▼0.00635.98 ▼55.8256.58 ▲5.47
Media Library /wp-admin/upload.php1,403 ▲34.26 ▲0.0297.04 ▼12.0442.65 ▼2.68

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function authSocialHero() in wp-content/plugins/socialhero-promotions/includes/frontend/assets/js/socialheroJs.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_cart() on null in wp-content/plugins/socialhero-promotions/includes/frontend/frontend-cartform.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/socialhero-promotions/includes/frontend/functions.php:2
    • > PHP Notice
      Trying to get property 'cart' of non-object in wp-content/plugins/socialhero-promotions/includes/frontend/frontend-cartform.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/socialhero-promotions/includes/backend/functions.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/socialhero-promotions/includes/backend/index.php:7

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)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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 your attention:
  • Contributors: Contributors not specified
The official readme.txt might help

socialhero-promotions/socialhero.php 92% from 13 tests

The main PHP file in "Socialhero Promotions" ver. 1.0.4 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("socialhero-promotions.php" instead of "socialhero.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected466 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP629345411
CSS10055

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods240.00%
▷ Protected methods360.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin