78% progrids-widgets

Code Review | ProGrids Widget Plugin

WordPress plugin ProGrids Widget Plugin scored78%from 54 tests.

About plugin

  • Plugin page: progrids-widgets
  • Plugin version: 3.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.1.0
  • WordPress version: 6.3.1
  • First release: Jan 10, 2014
  • Latest release: Sep 3, 2014
  • Number of updates: 45
  • Update frequency: every 5.2 days
  • Top authors: sazze (80%)slukatsky (22.22%)

Code review

54 tests

User reviews

4 reviews

Install metrics

30+ active /3,991 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.70ms] Passed 4 tests

Analyzing server-side resources used by ProGrids Widget Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0234.96 ▼0.34
Dashboard /wp-admin3.32 ▲0.0242.18 ▼4.81
Posts /wp-admin/edit.php3.37 ▲0.0243.87 ▼4.31
Add New Post /wp-admin/post-new.php5.90 ▲0.0279.91 ▼17.34
Media Library /wp-admin/upload.php3.25 ▲0.0237.76 ▲7.21

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 15 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
proGrids_version
db_upgraded
widget_recent-posts
can_compress_scripts
proGrids_siteurl

Browser metrics Passed 4 tests

An overview of browser requirements for ProGrids Widget Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲3514.27 ▼0.081.79 ▲0.0939.49 ▼1.19
Dashboard /wp-admin2,212 ▲325.64 ▼0.0782.50 ▼2.6770.19 ▲24.39
Posts /wp-admin/edit.php2,117 ▲171.98 ▲0.0139.85 ▲3.2233.89 ▲0.11
Add New Post /wp-admin/post-new.php1,694 ▲16622.05 ▼1.05747.14 ▲70.4057.07 ▼7.35
Media Library /wp-admin/upload.php1,420 ▲204.21 ▲0.0796.08 ▼13.8566.24 ▲19.79

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

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
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/progrids-widgets/views/installationCode.php
    • > /wp-content/plugins/progrids-widgets/views/upgradeCode.php
  • 13× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/progrids-widgets/views/main.php:13
    • > PHP Warning
      Use of undefined constant PROGRIDS_WIDGETS_HOST - assumed 'PROGRIDS_WIDGETS_HOST' (this will throw an Error in a future version of PHP) in wp-content/plugins/progrids-widgets/views/installationCode.php on line 20
    • > PHP Warning
      Use of undefined constant PROGRIDS_BASE_URL - assumed 'PROGRIDS_BASE_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/progrids-widgets/views/main.php on line 7
    • > PHP Notice
      Undefined variable: widgetId in wp-content/plugins/progrids-widgets/views/upgradeCode.php on line 11
    • > PHP Warning
      Use of undefined constant PROGRIDS_PLUGIN_URL - assumed 'PROGRIDS_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/progrids-widgets/views/main.php on line 3
    • > PHP Warning
      Use of undefined constant PROGRIDS_WIDGETS_HOST - assumed 'PROGRIDS_WIDGETS_HOST' (this will throw an Error in a future version of PHP) in wp-content/plugins/progrids-widgets/views/upgradeCode.php on line 19
    • > PHP Warning
      Use of undefined constant PROGRIDS_BASE_URL - assumed 'PROGRIDS_BASE_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/progrids-widgets/views/main.php on line 3
    • > PHP Notice
      Undefined variable: widgetId in wp-content/plugins/progrids-widgets/views/upgradeCode.php on line 7
    • > PHP Notice
      Undefined variable: widgetId in wp-content/plugins/progrids-widgets/views/installationCode.php on line 11
    • > PHP Notice
      Undefined variable: widgetId in wp-content/plugins/progrids-widgets/views/upgradeCode.php on line 21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
You can look at the official readme.txt

progrids-widgets/functions.php 92% from 13 tests

"ProGrids Widget Plugin" version 3.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("progrids-widgets.php" instead of "functions.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin332 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP75699268
CSS18064

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity6.67
▷ Minimum class complexity4.00
▷ Maximum class complexity8.00
Average method complexity2.31
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods13
▷ Static methods430.77%
▷ Public methods1292.31%
▷ Protected methods00.00%
▷ Private methods17.69%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants15
▷ Global constants1493.33%
▷ Class constants16.67%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.71MB with 0.49MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png226.35KB76.96KB▼ 66.00%
assets/screenshot-1.png67.31KB23.80KB▼ 64.65%
assets/screenshot-3.png398.88KB120.38KB▼ 69.82%
images/proGridsFav.png18.30KB0.72KB▼ 96.09%
images/proGridsHeader.png11.92KB5.68KB▼ 52.32%