84% mirror-gravatar

Code Review | Mirror Gravatar

WordPress plugin Mirror Gravatar scored84%from 54 tests.

About plugin

  • Plugin page: mirror-gravatar
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-6.0.2
  • WordPress version: 6.3.1
  • First release: Jun 9, 2022
  • Latest release: May 30, 2023
  • Number of updates: 6
  • Update frequency: every 59.0 days
  • Top authors: jwz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /520 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼7.25ms] Passed 4 tests

Analyzing server-side resources used by Mirror Gravatar
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.24 ▼6.88
Dashboard /wp-admin3.31 ▼0.0342.86 ▼13.94
Posts /wp-admin/edit.php3.36 ▲0.0143.84 ▼1.15
Add New Post /wp-admin/post-new.php5.89 ▲0.0190.70 ▼7.01
Media Library /wp-admin/upload.php3.23 ▲0.0135.10 ▲1.88

Server storage [IO: ▲0.03MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Mirror Gravatar
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲4913.22 ▼1.161.72 ▲0.1444.62 ▲4.41
Dashboard /wp-admin2,209 ▲214.95 ▼0.9694.57 ▼8.0567.95 ▲25.64
Posts /wp-admin/edit.php2,089 ▲32.06 ▲0.0939.26 ▲3.3635.36 ▲0.57
Add New Post /wp-admin/post-new.php1,514 ▼2317.73 ▼0.52607.79 ▲11.7350.83 ▼2.66
Media Library /wp-admin/upload.php1,391 ▼04.23 ▼0.0899.10 ▲1.5044.37 ▲1.48

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

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 | 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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/mirror-gravatar/mirror-gravatar.php:283

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration Passed 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
2 plugin tags: gravatar, comments

mirror-gravatar/mirror-gravatar.php Passed 13 tests

This is the main PHP file of "Mirror Gravatar" version 1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
62 characters long description:
Locally mirror commenters' Gravatar or Mastodon avatar images.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin503 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1106114420
JavaScript2242883

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
mystery128.png2.57KB2.67KB0.00%