94% ads-on-content-amp-pages

Code Review | Ads on Content AMP Pages

WordPress plugin Ads on Content AMP Pages scored 94% from 54 tests.

About plugin

  • Plugin page: ads-on-content-am...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • First release: Dec 31, 2017
  • Latest release: Jan 3, 2018
  • Number of updates: 20
  • Update frequency: every 0.2 days
  • Top authors: alaaabdelsamie (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

10+ active / 1,552 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Ads on Content AMP Pages
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.0553.14 ▲3.87
Dashboard /wp-admin3.44 ▲0.0333.29 ▼2.36
Posts /wp-admin/edit.php3.67 ▲0.0335.80 ▼1.13
Add New Post /wp-admin/post-new.php6.91 ▼0.0696.32 ▼1,203.92
Media Library /wp-admin/upload.php3.32 ▲0.0225.82 ▼3.42
Ads Content AMP /wp-admin/options-general.php?page=aacap_ads_content_amp3.2927.70

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Ads on Content AMP Pages
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,790 ▲4615.98 ▲0.267.01 ▲1.452.30 ▼0.07
Dashboard /wp-admin2,894 ▲336.15 ▼0.02118.59 ▼17.21153.51 ▼0.41
Posts /wp-admin/edit.php2,696 ▲23.24 ▲0.0164.29 ▲1.03139.84 ▼2.16
Add New Post /wp-admin/post-new.php1,722 ▲6122.00 ▲5.29434.36 ▲21.56152.69 ▲3.07
Media Library /wp-admin/upload.php1,703 ▲85.51 ▲0.06142.35 ▼0.51192.32 ▲2.34
Ads Content AMP /wp-admin/options-general.php?page=aacap_ads_content_amp1,0312.4455.10167.67

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ads-on-content-amp-pages/ads-on-content-amp-pages.php:46

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


Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (Settings), #2 (Ads on Content AMP Settings)
The official readme.txt is a good inspiration

ads-on-content-amp-pages/ads-on-content-amp-pages.php Passed 13 tests

The main PHP file in "Ads on Content AMP Pages" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
84 characters long description:
Insert Ads WithIn your Post Content AMP Pages in WordPress, To Make Money from AMP .

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected101 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.17
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
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions8100.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
icon-256x256.png18.98KB8.17KB▼ 56.93%
screenshot-1.png18.65KB7.36KB▼ 60.51%
screenshot-2.png19.01KB8.18KB▼ 56.95%