10% patro

Code Review | Patro

WordPress plugin Patro scored 10% from 54 tests.

About plugin

  • Plugin page: patro
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.3
  • WordPress version: 5.8.1
  • First release: Oct 14, 2015
  • Latest release: Jul 18, 2017
  • Number of updates: 42
  • Update frequency: every 15.3 days
  • Top authors: ughimire1 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 2,080 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Warning in wp-includes/functions.php+6461
    fopen(wp-content/plugins/patro/lib/../patro.php): failed to open stream: No such file or directory

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

Server-side resources used by Patro
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.1541.23 ▲14.82
Dashboard /wp-admin3.08 ▲0.0353.97 ▲3.74
Posts /wp-admin/edit.php3.13 ▲0.0353.77 ▲0.43
Add New Post /wp-admin/post-new.php5.44 ▲0.01103.16 ▼562.77
Media Library /wp-admin/upload.php3.03 ▲0.0238.63 ▼3.67

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 17 new files
Database: no new tables, 1 new option
New WordPress options
widget_patro_widget_id

Browser metrics Passed 4 tests

Checking browser requirements for Patro
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,807 ▲21116.42 ▲0.7915.98 ▲5.6749.85 ▼1.82
Dashboard /wp-admin2,967 ▲365.99 ▲0.05178.60 ▲0.02122.11 ▼3.17
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0077.90 ▼0.4890.06 ▼13.83
Add New Post /wp-admin/post-new.php1,683 ▲6818.69 ▼2.80452.39 ▲112.64109.67 ▼3.37
Media Library /wp-admin/upload.php1,807 ▼05.04 ▼0.01170.09 ▼13.87123.30 ▼10.26

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_patro_widget_id

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
Good news, no errors were detected

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 take a closer look at the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/patro/PatroWidget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/patro/lib/patroooo_lib.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === patro === )
  • Tags: Please delete some tags, you are using 17 tag instead of maximum 10
The official readme.txt might help

patro/Patro.php 92% from 13 tests

The main PHP file in "Patro" ver. 1.4 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("patro.php" instead of "Patro.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin937 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript241513537
PHP519037299
CSS2441101

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity4.00
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods21
▷ Static methods1047.62%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
4 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/prev.png1.96KB0.68KB▼ 65.61%
images/next.png1.94KB0.63KB▼ 67.24%
images/next_hover.png1.86KB0.62KB▼ 66.79%
images/prev_hover.png1.95KB0.63KB▼ 67.90%