77% reelgood-publishers-widget

Code Review | Where to Watch - Publisher's Widget

WordPress plugin Where to Watch - Publisher's Widget scored77%from 54 tests.

About plugin

  • Plugin page: reelgood-publishe...
  • Plugin version: 0.0.8
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.5.1
  • WordPress version: 6.3.1
  • First release: Nov 21, 2019
  • Latest release: Oct 7, 2020
  • Number of updates: 20
  • Update frequency: every 17.2 days
  • Top authors: douwebosrg (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /2,813 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.31MB] [CPU: ▼4.87ms] Passed 4 tests

Analyzing server-side resources used by Where to Watch - Publisher's Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.2941.35 ▲5.20
Dashboard /wp-admin3.67 ▲0.3350.16 ▼8.04
Posts /wp-admin/edit.php3.73 ▲0.3647.32 ▼2.33
Add New Post /wp-admin/post-new.php6.21 ▲0.3284.98 ▼12.82
Media Library /wp-admin/upload.php3.54 ▲0.3037.08 ▲3.71

Server storage [IO: ▲0.30MB] [DB: ▲0.04MB] Passed 3 tests

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

Browser metrics Passed 4 tests

A check of browser resources used by Where to Watch - Publisher's Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,904 ▲14314.31 ▼0.424.43 ▲2.8342.51 ▼1.27
Dashboard /wp-admin2,265 ▲855.92 ▲0.31113.34 ▲24.2080.85 ▲37.67
Posts /wp-admin/edit.php2,192 ▲922.97 ▲0.9943.12 ▲4.8331.12 ▼3.35
Add New Post /wp-admin/post-new.php1,603 ▲7723.01 ▼0.70688.13 ▼6.2430.86 ▼27.37
Media Library /wp-admin/upload.php1,479 ▲885.39 ▲1.17106.79 ▲4.0088.08 ▲41.96

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • reelgood_pub_settings
    • can_compress_scripts
    • reelgood_pub_settings_fetch_time
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/reelgood-publishers-widget/reelgood_bundle_js.php
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/reelgood-publishers-widget/admin/actions/service_settings_actions.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/reelgood-publishers-widget/admin/actions/search_actions.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/reelgood-publishers-widget/admin/actions/user_settings_actions.php:11
    • > PHP Warning
      Use of undefined constant REELGOOD_PUBLISHERS_WIDGET_BUNDLE_API_KEY - assumed 'REELGOOD_PUBLISHERS_WIDGET_BUNDLE_API_KEY' (this will throw an Error in a future version of PHP) in wp-content/plugins/reelgood-publishers-widget/admin/pages/settings_page.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/reelgood-publishers-widget/admin/pages/settings_page.php:221
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/reelgood-publishers-widget/admin/reelgood_publishers_widget_editor.php:25
    • > PHP Warning
      Use of undefined constant REELGOOD_PUBLISHERS_WIDGET_BUNDLE_JS_URL - assumed 'REELGOOD_PUBLISHERS_WIDGET_BUNDLE_JS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/reelgood-publishers-widget/admin/pages/settings_page.php on line 5
    • > PHP Warning
      Use of undefined constant REELGOOD_PUBLISHERS_WIDGET_BUNDLE_JS_URL - assumed 'REELGOOD_PUBLISHERS_WIDGET_BUNDLE_JS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/reelgood-publishers-widget/reelgood_bundle_js.php on line 2
    • > PHP Warning
      Use of undefined constant REELGOOD_PUBLISHERS_WIDGET_BUNDLE_API_KEY - assumed 'REELGOOD_PUBLISHERS_WIDGET_BUNDLE_API_KEY' (this will throw an Error in a future version of PHP) in wp-content/plugins/reelgood-publishers-widget/reelgood_bundle_js.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/reelgood-publishers-widget/admin/actions/styling_settings_actions.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 86% 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
Attributes that require attention:
  • Tags: There are too many tags (12 tag instead of maximum 10)
The official readme.txt is a good inspiration

reelgood-publishers-widget/index.php 77% from 13 tests

The primary PHP file in "Where to Watch - Publisher's Widget" version 0.0.8 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("reelgood-publishers-widget.php" instead of "index.php")
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin4,641 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript12454231,801
PHP193664851,573
CSS10215511,204
SVG60263

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity6.00
▷ Minimum class complexity1.00
▷ Maximum class complexity18.00
Average method complexity2.15
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods39
▷ Static methods1230.77%
▷ Public methods3384.62%
▷ Protected methods00.00%
▷ Private methods615.38%
Functions57
▷ Named functions5189.47%
▷ Anonymous functions610.53%
Constants15
▷ Global constants15100.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
3 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/reelgood_logo@3x.png1.59KB1.00KB▼ 37.10%
images/reelgood_logo@2x.png1.11KB0.84KB▼ 24.54%
images/reelgood_logo@1x.png0.57KB0.49KB▼ 14.29%