10% amp-by-zaenu

Code Review | AMP by Zaenu

WordPress plugin AMP by Zaenu scored10%from 54 tests.

About plugin

  • Plugin page: amp-by-zaenu
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.8
  • WordPress version: 6.3.1
  • First release: Aug 5, 2017
  • Latest release: Aug 7, 2017
  • Number of updates: 7
  • Update frequency: every 0.3 days
  • Top authors: andonk.ndonk (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /938 total downloads


Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/amp-by-zaenu/index.php+16
    Constant EP_PERMALINK already defined

Server metrics [RAM: ▼1.96MB] [CPU: ▼49.60ms] Passed 4 tests

This is a short check of server-side resources used by AMP by Zaenu
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.435.72 ▼32.14
Dashboard /wp-admin2.05 ▼1.255.59 ▼38.06
Posts /wp-admin/edit.php2.05 ▼1.315.52 ▼41.15
Add New Post /wp-admin/post-new.php2.05 ▼3.845.22 ▼87.04
Media Library /wp-admin/upload.php2.05 ▼1.186.00 ▼29.26
AMP by Zaenu /wp-admin/options-general.php?page=amp_by_zaenu_setting2.054.98

Server storage [IO: ▲0.07MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
These are issues you should consider
  • There were 1 file (26.08KB) illegally modified outside of "wp-content/plugins/amp-by-zaenu/" and "wp-content/uploads/"
    • (new file) wp-content/themes/twentytwentyone/amp-single.php
Filesystem: 6 new files
Database: no new tables, 11 new options
New WordPress options

Browser metrics Passed 4 tests

AMP by Zaenu: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,970 ▲22414.75 ▲0.381.92 ▲0.1340.04 ▼8.85
Dashboard /wp-admin2,351 ▲1606.50 ▲1.60116.01 ▲17.4437.96 ▼3.26
Posts /wp-admin/edit.php2,260 ▲1713.42 ▲1.4254.02 ▲15.4035.41 ▲0.31
Add New Post /wp-admin/post-new.php1,521 ▼2117.62 ▼0.50644.47 ▼5.3536.26 ▼15.29
Media Library /wp-admin/upload.php1,396 ▲54.14 ▼0.0682.01 ▼13.3844.14 ▼2.00
AMP by Zaenu /wp-admin/options-general.php?page=amp_by_zaenu_setting1,0393.0638.2955.70

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/amp-by-zaenu/index.php+16
    Constant EP_PERMALINK already defined
  • This plugin does not fully uninstall, leaving 11 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • zaenu_adsenseid
    • zaenu_logo
    • zaenu_adsenseslot
    • widget_recent-posts
    • db_upgraded
    • zaenu_analytics
    • zaenu_icon
    • widget_recent-comments
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=amp_by_zaenu_setting
    • > Notice in wp-content/plugins/amp-by-zaenu/index.php+16
    Constant EP_PERMALINK already defined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=amp_by_zaenu_setting
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/options-general.php?page=amp_by_zaenu_setting
    • > Notice in wp-content/plugins/amp-by-zaenu/index.php+175
    Undefined index: zaenu_submit

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 fix the following items
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/amp-by-zaenu/index.php:15
    • > PHP Notice
      Undefined variable: fixreplace1 in wp-content/plugins/amp-by-zaenu/amp-single.php on line 1169
    • > PHP Notice
      Undefined variable: fixreplace2 in wp-content/plugins/amp-by-zaenu/amp-single.php on line 1170
    • > PHP Notice
      Undefined variable: fixreplace4 in wp-content/plugins/amp-by-zaenu/amp-single.php on line 1170

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side


Plugin configuration 96% from 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
4 plugin tags: customize, google, seo, amp

amp-by-zaenu/index.php 92% from 13 tests

The principal PHP file in "AMP by Zaenu" v. 1.2.1 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 ("amp-by-zaenu.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected2,239 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
▷ Static methods266.67%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions10100.00%
▷ Anonymous functions00.00%
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin