84% morpcs-air-quality-widget

Code Review | MORPC's Air Quality Widget

WordPress plugin MORPC's Air Quality Widget scored84%from 54 tests.

About plugin

  • Plugin page: morpcs-air-qualit...
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.9
  • WordPress version: 6.3.1
  • First release: Feb 20, 2019
  • Latest release: Jan 31, 2022
  • Number of updates: 16
  • Update frequency: every 67.4 days
  • Top authors: morpc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,017 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
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼3.79ms] Passed 4 tests

Server-side resources used by MORPC's Air Quality Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0842.80 ▲3.16
Dashboard /wp-admin3.39 ▲0.0950.68 ▼3.43
Posts /wp-admin/edit.php3.51 ▲0.1551.49 ▲1.06
Add New Post /wp-admin/post-new.php5.97 ▲0.0997.67 ▼8.25
Media Library /wp-admin/upload.php3.32 ▲0.0941.23 ▼4.52

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 33 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for MORPC's Air Quality Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲7213.66 ▼0.731.51 ▼0.4740.56 ▼5.30
Dashboard /wp-admin2,242 ▲364.86 ▼0.02108.58 ▲3.0942.22 ▼6.49
Posts /wp-admin/edit.php2,121 ▲182.04 ▲0.0536.35 ▼2.9530.64 ▼8.73
Add New Post /wp-admin/post-new.php1,555 ▲1023.10 ▼0.28630.48 ▼53.4060.44 ▼9.91
Media Library /wp-admin/upload.php1,418 ▲244.26 ▲0.09119.33 ▲15.0049.19 ▲0.57

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/morpcs-air-quality-widget/admin/partials/aqi-widget-admin-display.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: air quality, aqi, morpc, airnow

morpcs-air-quality-widget/aqi-widget.php 92% from 13 tests

Analyzing the main PHP file in "MORPC's Air Quality Widget" version 1.2.0
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("morpcs-air-quality-widget.php" instead of "aqi-widget.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
Success! There were no dangerous files found in this plugin1,018 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP12123408450
JavaScript39072413
CSS23227155

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity2.71
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.36
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods33
▷ Static methods26.06%
▷ Public methods2678.79%
▷ Protected methods00.00%
▷ Private methods721.21%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
10 PNG files occupy 0.29MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/aqi_compact_4.png1.15KB0.79KB▼ 31.47%
public/img/aqi_compact_1.png1.45KB0.78KB▼ 46.60%
public/img/aqi_page_3.png53.93KB20.41KB▼ 62.15%
public/img/aqi_page_5.png53.00KB19.86KB▼ 62.53%
public/img/aqi_compact_2.png1.16KB0.78KB▼ 33.16%