72% ztorie

Code Review | AMP Stories for WordPress - by Ztorie

WordPress plugin AMP Stories for WordPress - by Ztorie scored 72% from 54 tests.

About plugin

  • Plugin page: ztorie
  • Plugin version: 1.1.5
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.7
  • WordPress version: 5.8.1
  • First release: Nov 30, 2018
  • Latest release: Dec 5, 2018
  • Number of updates: 22
  • Update frequency: every 0.3 days
  • Top authors: ipauler (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 884 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: ▼1.89MB] [CPU: ▼183.50ms] Passed 4 tests

An overview of server-side resources used by AMP Stories for WordPress - by Ztorie
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /1.74 ▼1.094.86 ▼30.73
Dashboard /wp-admin1.76 ▼1.295.95 ▼38.14
Posts /wp-admin/edit.php1.76 ▼1.344.73 ▼36.01
Add New Post /wp-admin/post-new.php1.76 ▼3.674.87 ▼626.96
Media Library /wp-admin/upload.php1.76 ▼1.255.35 ▼32.87
General /wp-admin/admin.php?page=ztorie_admin1.764.83

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 31 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by AMP Stories for WordPress - by Ztorie
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,157 ▲56117.13 ▲1.6412.99 ▲3.3549.29 ▲7.36
Dashboard /wp-admin3,089 ▲1596.58 ▲0.45129.40 ▼26.60122.59 ▲10.43
Posts /wp-admin/edit.php2,865 ▲1262.98 ▲0.2963.75 ▼1.8290.85 ▲4.26
Add New Post /wp-admin/post-new.php1,744 ▲7218.85 ▼0.24381.84 ▲18.88127.69 ▲26.20
Media Library /wp-admin/upload.php1,856 ▲495.50 ▲0.45120.98 ▼25.83132.35 ▲14.43
General /wp-admin/admin.php?page=ztorie_admin1,3342.7557.40123.77

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5663
    wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the custom_admin_script handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=ztorie_admin
    • > User notice in wp-includes/functions.php+5663
    wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the custom_admin_script handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/admin.php?page=ztorie_admin
    • > Notice in wp-content/plugins/ztorie/ztorie.php+372
    Undefined index: save

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/ztorie/assets/template/story-template.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ztorie/ztorie-admin-page.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ztorie/ztorie.php:25

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=ztorie_admin
    • > Network (severe)
    http://wp.loc/wp-content/plugins/ztorie/assets/images/confetti.png - Failed to load resource: net::ERR_NAME_NOT_RESOLVED

Optimizations

Plugin configuration 97% 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
Attributes that need to be fixed:
  • Contributors: Plugin contributors not specified
The official readme.txt is a good inspiration

ztorie/ztorie.php Passed 13 tests

The main file in "AMP Stories for WordPress - by Ztorie" v. 1.1.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
30 characters long description:
plugin for using Ztorie widget

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin1,897 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
HTML6247101,434
PHP310044359
JavaScript17388
CSS12016

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity25.00
▷ Minimum class complexity25.00
▷ Maximum class complexity25.00
Average method complexity2.09
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
18 PNG files occupy 1.45MB with 0.68MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon-2.png0.15KB0.15KB0.00%
assets/images/icon_wp_hover.png1.45KB0.92KB▼ 36.52%
assets/images/middle-1.png285.88KB32.38KB▼ 88.67%
assets/images/Illustration_bottom.png259.85KB65.89KB▼ 74.64%
assets/images/icon_wp_active.png1.09KB0.72KB▼ 33.90%