76% amp-non-amp-auto-ads

Code Review | AMP & Non-AMP Auto Ads

WordPress plugin AMP & Non-AMP Auto Ads scored 76% from 54 tests.

About plugin

  • Plugin page: amp-non-amp-auto-ads
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2
  • WordPress version: 5.8.1
  • First release: Apr 12, 2018
  • Latest release: May 10, 2019
  • Number of updates: 19
  • Update frequency: every 20.7 days
  • Top authors: piclaunch (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,222 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

Server-side resources used by AMP & Non-AMP Auto Ads
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.0240.29 ▲8.00
Dashboard /wp-admin3.08 ▲0.0347.50 ▲10.42
Posts /wp-admin/edit.php3.17 ▲0.0642.25 ▼2.52
Add New Post /wp-admin/post-new.php5.44 ▲0.0191.95 ▼680.58
Media Library /wp-admin/upload.php3.02 ▲0.0227.89 ▼5.39
AMP non-AMP Ads /wp-admin/options-general.php?page=ampnonampads3.0627.37

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 29 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for AMP & Non-AMP Auto Ads
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,821 ▲22516.25 ▲0.6111.93 ▲2.8545.84 ▼4.28
Dashboard /wp-admin2,982 ▲525.93 ▼0.21135.60 ▼4.86122.23 ▲17.95
Posts /wp-admin/edit.php2,748 ▲92.71 ▼0.0163.81 ▲1.5792.22 ▲2.53
Add New Post /wp-admin/post-new.php1,879 ▼1019.06 ▲3.05342.97 ▼51.75106.20 ▼2.66
Media Library /wp-admin/upload.php1,816 ▲65.02 ▼0.03139.44 ▼14.20117.48 ▼0.66
AMP non-AMP Ads /wp-admin/options-general.php?page=ampnonampads1,5323.6479.8798.83

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ampnonampads
    • > Notice in wp-content/plugins/amp-non-amp-auto-ads/admin/partials/ampnonampads-admin-display.php+38
    Trying to access array offset on value of type bool

SRP 0% 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
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/amp-non-amp-auto-ads/public/partials/ampnonampads-public-display.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/amp-non-amp-auto-ads/admin/partials/ampnonampads-admin-display.php:19

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=ampnonampads
    • > Network (severe)
    http://whatsq.com/wp-content/uploads/2018/04/ANA.png - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 87% 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 your attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === amp-non-amp-auto-ads === )
  • Donate link: Invalid URI found ("")
You can take inspiration from this readme.txt

amp-non-amp-auto-ads/ampnonampads.php 85% from 13 tests

"AMP & Non-AMP Auto Ads" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("amp-non-amp-auto-ads.php" instead of "ampnonampads.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
Everything looks great! No dangerous files found in this plugin441 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12199585435
JavaScript24546
CSS2080

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity6.00
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity2.09
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods32
▷ Static methods26.25%
▷ Public methods2784.38%
▷ Protected methods00.00%
▷ Private methods515.62%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
7 PNG files occupy 1.42MB with 0.93MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-3.png85.63KB38.68KB▼ 54.83%
assets/screenshot-2.png207.70KB50.79KB▼ 75.54%
assets/banner-772x250.png154.08KB47.00KB▼ 69.50%
assets/icon-256x256.png17.41KB7.19KB▼ 58.73%
assets/1500x500.png421.35KB125.41KB▼ 70.24%