73% tmediaa-weather-plugin

Code Review | tMediaa weather plugin

WordPress plugin tMediaa weather plugin scored73%from 54 tests.

About plugin

  • Plugin page: tmediaa-weather-p...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-3.5
  • WordPress version: 6.3.1
  • First release: Apr 7, 2013
  • Latest release: Jul 2, 2013
  • Number of updates: 13
  • Update frequency: every 6.7 days
  • Top authors: tmediaa (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,286 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.52MB] [CPU: ▼44.52ms] Passed 4 tests

Analyzing server-side resources used by tMediaa weather plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.46 ▼1.009.92 ▼30.42
Dashboard /wp-admin2.48 ▼0.8214.02 ▼35.54
Posts /wp-admin/edit.php2.48 ▼0.8713.41 ▼35.05
Add New Post /wp-admin/post-new.php2.48 ▼3.4013.13 ▼77.08
Media Library /wp-admin/upload.php2.48 ▼0.7411.74 ▼26.54

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

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

Browser metrics Passed 4 tests

A check of browser resources used by tMediaa weather plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,889 ▲15413.68 ▼1.007.04 ▲5.2640.09 ▼21.15
Dashboard /wp-admin2,206 ▲184.84 ▼1.04109.43 ▼4.4539.04 ▼4.42
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0039.39 ▲2.6134.87 ▲0.48
Add New Post /wp-admin/post-new.php1,542 ▲918.03 ▼5.13613.94 ▼72.5248.69 ▼10.21
Media Library /wp-admin/upload.php1,385 ▼34.20 ▼0.0295.77 ▼12.5642.88 ▼0.24

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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 cannot be uninstalled
    • > User deprecated in wp-includes/functions.php+5747
    Function load_plugin_textdomain was called with an argument that is deprecated since version 2.7.0 with no alternative available.
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • db_upgraded
    • widget_tmediaa_weather_plugin
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tmediaa-weather-plugin/tmediaa_iran_weather.php:514

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 19 tag instead of maximum 10
  • Screenshots: Please add an image for screenshot #1 (Weather widget in Persian and English)
You can take inspiration from this readme.txt

tmediaa-weather-plugin/tmediaa_iran_weather.php 92% from 13 tests

The main PHP file in "tMediaa weather plugin" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("tmediaa-weather-plugin.php" instead of "tmediaa_iran_weather.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected1,502 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP17756635
PO File1194194406
CSS3360282
JavaScript26028179

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 132)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity132.00
▷ Minimum class complexity132.00
▷ Maximum class complexity132.00
Average method complexity44.67
▷ Minimum method complexity1.00
▷ Maximum method complexity132.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
24 PNG files occupy 0.26MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/48.png4.49KB2.33KB▼ 48.02%
img/49.png8.01KB4.60KB▼ 42.60%
img/14.png3.64KB3.15KB▼ 13.69%
img/32.png2.41KB1.44KB▼ 39.99%
img/44.png2.25KB1.44KB▼ 35.78%