84% amp-story

Code Review | Amp Stories for Wordpress

WordPress plugin Amp Stories for Wordpress scored84%from 54 tests.

About plugin

  • Plugin page: amp-story
  • Plugin version: 1.3.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.2.2
  • WordPress version: 6.3.1
  • First release: Apr 25, 2018
  • Latest release: Jul 7, 2019
  • Number of updates: 31
  • Update frequency: every 14.2 days
  • Top authors: eliasmarca (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /7,119 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.20MB] [CPU: ▼15.15ms] Passed 4 tests

A check of server-side resources used by Amp Stories for Wordpress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.92 ▼0.5427.74 ▼20.19
Dashboard /wp-admin3.43 ▲0.1351.28 ▼0.11
Posts /wp-admin/edit.php3.22 ▼0.1432.84 ▼15.96
Add New Post /wp-admin/post-new.php5.70 ▼0.1978.94 ▼24.34
Media Library /wp-admin/upload.php3.29 ▲0.0742.30 ▲7.23

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Amp Stories for Wordpress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲3014.24 ▼0.331.89 ▼0.1847.48 ▲2.53
Dashboard /wp-admin2,197 ▲235.58 ▼0.0286.30 ▼4.2035.70 ▼1.27
Posts /wp-admin/edit.php2,102 ▲21.99 ▼0.0436.69 ▼3.1132.81 ▼6.70
Add New Post /wp-admin/post-new.php8,545 ▲7,01928.28 ▲4.631,028.33 ▲378.8361.45 ▲3.49
Media Library /wp-admin/upload.php1,402 ▲24.31 ▲0.1294.79 ▼5.5043.43 ▼2.35

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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 fix the following items
  • 115× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Use of undefined constant VP_PUBLIC_URL - assumed 'VP_PUBLIC_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/amp-story/vafpress/config/dependencies.php on line 94
    • > PHP Fatal error
      Uncaught Error: Class 'VP_View' not found in wp-content/plugins/amp-story/vafpress/views/control/sorter.php:1
    • > PHP Notice
      Undefined variable: set in wp-content/plugins/amp-story/vafpress/views/option/set.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'VP_Option_Control_Group' not found in wp-content/plugins/amp-story/vafpress/classes/option/control/group/menu.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'VP_Control_FieldMultiImage' not found in wp-content/plugins/amp-story/vafpress/classes/control/field/radioimage.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'VP_Control_FieldMulti' not found in wp-content/plugins/amp-story/vafpress/classes/control/field/sorter.php:3
    • > PHP Warning
      Use of undefined constant VP_PUBLIC_URL - assumed 'VP_PUBLIC_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/amp-story/vafpress/config/dependencies.php on line 172
    • > PHP Fatal error
      Uncaught Error: Class 'VP_View' not found in wp-content/plugins/amp-story/vafpress/views/control/date.php:1
    • > PHP Warning
      Use of undefined constant VP_PUBLIC_URL - assumed 'VP_PUBLIC_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/amp-story/vafpress/config/dependencies.php on line 176
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/amp-story/vafpress/config/messages.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Donate link: Please fix this invalid URI: "paypal.me/ampstories/10"
The official readme.txt might help

amp-story/amp-story.php Passed 13 tests

The entry point to "Amp Stories for Wordpress" version 1.3.2 is a PHP file that has certain tags in its header comment area
104 characters long description:
Amp Stories for Wordpress. Amp Story allows you to create a visual storytelling format for the open web.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected15,768 lines of code in 156 files:
LanguageFilesBlank linesComment linesLines of code
PHP912,0362,3038,996
CSS141541763,309
JavaScript474472982,959
SVG100414
Markdown231089
JSON1001

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 102)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity21.38
▷ Minimum class complexity1.00
▷ Maximum class complexity271.00
Average method complexity3.36
▷ Minimum method complexity1.00
▷ Maximum method complexity102.00
Code structure
Namespaces0
Interfaces2
Traits0
Classes56
▷ Abstract classes47.14%
▷ Concrete classes5292.86%
▷ Final classes00.00%
Methods505
▷ Static methods8917.62%
▷ Public methods47293.47%
▷ Protected methods193.76%
▷ Private methods142.77%
Functions28
▷ Named functions28100.00%
▷ Anonymous functions00.00%
Constants36
▷ Global constants3391.67%
▷ Class constants38.33%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
23 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vafpress/public/img/vp-logo.png1.94KB0.66KB▼ 65.94%
vafpress/public/img/vp_shortcode_icon_sprite.png1.55KB0.42KB▼ 73.10%
vafpress/public/img/select2/select2x2.png0.83KB0.77KB▼ 6.15%
vafpress/public/img/bootstrap-colorpicker/saturation.png8.61KB5.13KB▼ 40.41%
vafpress/public/img/vp-sprite.png12.79KB4.90KB▼ 61.71%