84% mediavine-amp-redirect

Code Review | Mediavine AMP Redirect

WordPress plugin Mediavine AMP Redirect scored84%from 54 tests.

About plugin

  • Plugin page: mediavine-amp-red...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Jun 27, 2017
  • Latest release: Jun 27, 2017
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: mediavine (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /1,509 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.39ms] Passed 4 tests

An overview of server-side resources used by Mediavine AMP Redirect
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.32 ▼5.28
Dashboard /wp-admin3.31 ▲0.0148.72 ▼3.13
Posts /wp-admin/edit.php3.37 ▲0.0145.81 ▼1.94
Add New Post /wp-admin/post-new.php5.90 ▲0.0189.61 ▼3.21
Media Library /wp-admin/upload.php3.24 ▲0.0140.35 ▲0.81

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Mediavine AMP Redirect
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.31 ▼0.061.88 ▼0.0240.02 ▼4.12
Dashboard /wp-admin2,195 ▲145.62 ▼0.0185.60 ▼20.5638.82 ▼2.55
Posts /wp-admin/edit.php2,100 ▲31.94 ▼0.0838.02 ▲2.0533.55 ▼1.81
Add New Post /wp-admin/post-new.php1,526 ▼223.93 ▲1.05678.94 ▲2.8060.64 ▼3.43
Media Library /wp-admin/upload.php1,400 ▲64.24 ▼0.02110.08 ▲9.5846.60 ▲0.45

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/mediavine-amp-redirect/mv-amp-redirect.php:48

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: amp, redirect, remove amp, mediavine

mediavine-amp-redirect/mv-amp-redirect.php 92% from 13 tests

The principal PHP file in "Mediavine AMP Redirect" v. 1.0.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("mediavine-amp-redirect.php" instead of "mv-amp-redirect.php")

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
Good job! No executable or dangerous file extensions detected35 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP171135

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.20
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods240.00%
▷ Public methods5100.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
PNG images were not found in this plugin