83% ipma-weather-widget

Code Review | Weather Forecast in Portugal

WordPress plugin Weather Forecast in Portugal scored 83% from 54 tests.

About plugin

  • Plugin page: ipma-weather-widget
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-5.0
  • WordPress version: 6.3.1
  • First release: Aug 28, 2017
  • Latest release: Nov 21, 2018
  • Number of updates: 7
  • Update frequency: every 153.7 days
  • Top authors: dipcode (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active / 1,461 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.09MB] [CPU: ▼5.01ms] Passed 4 tests

This is a short check of server-side resources used by Weather Forecast in Portugal
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0942.01 ▲0.99
Dashboard /wp-admin3.38 ▲0.0845.26 ▼1.55
Posts /wp-admin/edit.php3.50 ▲0.1447.82 ▼2.51
Add New Post /wp-admin/post-new.php5.98 ▲0.1092.73 ▼16.98
Media Library /wp-admin/upload.php3.31 ▲0.0836.39 ▲2.98

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 76 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_meteo-ipma
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Weather Forecast in Portugal: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,944 ▲20913.91 ▼0.4517.08 ▲15.3842.60 ▼2.41
Dashboard /wp-admin2,210 ▲255.83 ▲0.79115.37 ▲1.4939.30 ▼4.29
Posts /wp-admin/edit.php2,093 ▲12.02 ▲0.0339.13 ▼0.2834.54 ▼0.42
Add New Post /wp-admin/post-new.php1,532 ▼123.35 ▲0.07604.15 ▼1.9349.11 ▲1.53
Media Library /wp-admin/upload.php1,395 ▲134.27 ▲0.0498.89 ▲1.0846.18 ▲0.76

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • widget_meteo-ipma
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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
Please fix the following items
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/ipma-weather-widget/public/partials/widget.php on line 17
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ipma-weather-widget/widgets/class-meteo-ipma.php:17
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ipma-weather-widget/public/partials/widget.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/ipma-weather-widget/admin/partials/widget-form.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/ipma-weather-widget/public/partials/widget.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: ipma, dipcode, tempo, celsius, sidebar...

ipma-weather-widget/ipma-widget.php 77% from 13 tests

The entry point to "Weather Forecast in Portugal" version 1.0.4 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ipma-weather-widget.php" instead of "ipma-widget.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Description: Please don't use more than 140 characters for the plugin description (currently 181 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin482 lines of code in 67 files:
LanguageFilesBlank linesComment linesLines of code
PHP13119512318
PO File14345108
JavaScript50495054
CSS3032

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods32
▷ Static methods39.38%
▷ Public methods2784.38%
▷ Protected methods00.00%
▷ Private methods515.62%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/sprite.png3.51KB2.05KB▼ 41.59%
public/img/logo.png5.68KB3.20KB▼ 43.63%