83% amp-blocks

Code Review | Gutenberg Blocks for AMP with Design Library

WordPress plugin Gutenberg Blocks for AMP with Design Library scored83%from 54 tests.

About plugin

  • Plugin page: amp-blocks
  • Plugin version: 1.6.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.4
  • WordPress version: 6.3.1
  • First release: Nov 27, 2019
  • Latest release: May 25, 2021
  • Number of updates: 121
  • Update frequency: every 4.5 days
  • Top authors: magazine3 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /10,585 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼2.84MB] [CPU: ▼797,436.37ms] Passed 4 tests

An overview of server-side resources used by Gutenberg Blocks for AMP with Design Library
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.96 ▼14.6151.48 ▼3,189,723.20
Dashboard /wp-admin4.98 ▲1.6358.30 ▲2.87
Posts /wp-admin/edit.php4.98 ▲1.5763.26 ▲10.62
Add New Post /wp-admin/post-new.php5.98 ▲0.0566.60 ▼35.77
Media Library /wp-admin/upload.php4.98 ▲1.7050.59 ▲13.11

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 43 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Gutenberg Blocks for AMP with Design Library
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.24 ▼0.111.50 ▼0.5743.52 ▼3.04
Dashboard /wp-admin2,200 ▲205.62 ▲0.0093.32 ▲3.5643.57 ▲1.22
Posts /wp-admin/edit.php2,153 ▲501.98 ▲0.0339.18 ▲0.2736.39 ▼0.52
Add New Post /wp-admin/post-new.php1,677 ▲15126.09 ▲2.47722.75 ▲46.9140.51 ▼21.56
Media Library /wp-admin/upload.php1,405 ▲24.25 ▲0.07107.24 ▲8.6244.44 ▼1.15

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/amp-blocks/dist/template.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots lack descriptions #1, #10, #11, #12, #13, #14, #15, #16, #17, #18, #19, #2, #3, #4, #5, #6, #7, #8, #9 in amp-blocks/assets to your readme.txt
You can look at the official readme.txt

amp-blocks/amp-blocks.php 85% from 13 tests

"Gutenberg Blocks for AMP with Design Library" version 1.6.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Domain Path: The domain path folder was not found ("/languages")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 147 characters long)

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin10,756 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
PHP72794914,802
CSS23192903,038
JavaScript103671742,534
Sass1560382

PHP code 0% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 2,980)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 735)
Cyclomatic complexity
Average complexity per logical line of code1.49
Average class complexity771.50
▷ Minimum class complexity1.00
▷ Maximum class complexity2,980.00
Average method complexity55.07
▷ Minimum method complexity1.00
▷ Maximum method complexity735.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods57
▷ Static methods35.26%
▷ Public methods5494.74%
▷ Protected methods00.00%
▷ Private methods35.26%
Functions17
▷ Named functions1482.35%
▷ Anonymous functions317.65%
Constants8
▷ Global constants8100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
modules/gutenberg/assets/images/user-df-img.png3.57KB1.88KB▼ 47.43%