78% amp-revolution

Code Review | AMP Revolution

WordPress plugin AMP Revolution scored 78% from 54 tests.

About plugin

  • Plugin page: amp-revolution
  • Plugin version: 0.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.8
  • WordPress version: 5.8.1
  • First release: Jul 24, 2017
  • Latest release: Jul 27, 2017
  • Number of updates: 8
  • Update frequency: every 0.5 days
  • Top authors: savagecodes (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active / 883 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.24MB] [CPU: ▼143.53ms] Passed 4 tests

A check of server-side resources used by AMP Revolution
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.94 ▲0.2232.11 ▲10.67
Dashboard /wp-admin3.36 ▲0.3150.96 ▲5.58
Posts /wp-admin/edit.php3.42 ▲0.3153.64 ▲6.53
Add New Post /wp-admin/post-new.php5.64 ▲0.2090.99 ▼585.03
Media Library /wp-admin/upload.php3.22 ▲0.2237.82 ▼1.21
Install Plugins /wp-admin/admin.php?page=required-plugins3.3231.99
AMP Revolution /wp-admin/admin.php?page=amp-revolution3.2336.16

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, 4 new options
New WordPress options
customcss
integrator
optimizator
personalizator

Browser metrics Passed 4 tests

An overview of browser requirements for AMP Revolution
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,990 ▲39418.11 ▲2.217.75 ▲0.0348.32 ▼4.65
Dashboard /wp-admin3,254 ▲3248.11 ▲1.97174.47 ▲4.11128.14 ▲5.45
Posts /wp-admin/edit.php3,068 ▲3294.31 ▲1.6391.51 ▲21.75108.16 ▲13.59
Add New Post /wp-admin/post-new.php1,751 ▲17018.43 ▲2.00351.07 ▼129.04132.07 ▲8.56
Media Library /wp-admin/upload.php1,915 ▲1114.93 ▼0.11121.27 ▼27.51129.23 ▲9.82
Install Plugins /wp-admin/admin.php?page=required-plugins1,5783.9479.5581.63
AMP Revolution /wp-admin/admin.php?page=amp-revolution3,7295.55154.71119.42

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 4 options
    • optimizator
    • integrator
    • customcss
    • personalizator

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_single() in wp-content/plugins/amp-revolution/views/FrontEnd/related-posts.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function post_password_required() in wp-content/plugins/amp-revolution/views/FrontEnd/comments.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'ARSCP_AMP_Revolution' not found in wp-content/plugins/amp-revolution/views/FrontEnd/analyticsCode.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/amp-revolution/views/FrontEnd/header-bar.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/amp-revolution/views/FrontEnd/footer.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=amp-revolution
    • > Network (severe)
    https://www.savagecodes.com/wp-content/uploads/2015/06/logo.png - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
2 plugin tags: amp, mobile

amp-revolution/ARSCP-AMP-revolution.php 92% from 13 tests

The entry point to "AMP Revolution" version 0.1.1 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("amp-revolution.php" instead of "ARSCP-AMP-revolution.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
Success! There were no dangerous files found in this plugin3,201 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP126911,8483,201

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity32.92
▷ Minimum class complexity1.00
▷ Maximum class complexity207.00
Average method complexity3.64
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods157
▷ Static methods63.82%
▷ Public methods13485.35%
▷ Protected methods2314.65%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected