63% web-stories

Code Review | Web Stories

WordPress plugin Web Stories scored63%from 54 tests.

About plugin

  • Plugin page: web-stories
  • Plugin version: 1.35.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.4
  • WordPress version: 6.3.1
  • First release: Sep 22, 2020
  • Latest release: Nov 15, 2023
  • Number of updates: 137
  • Update frequency: every 9.6 days
  • Top authors: swissspidy (89.05%)google (7.3%)willchou (5.11%)

Code review

54 tests

User reviews

78 reviews

Install metrics

100,000+ active /1,990,559 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲3.79MB] [CPU: ▲26.68ms] Passed 4 tests

A check of server-side resources used by Web Stories
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /7.30 ▲3.8361.18 ▲21.40
Dashboard /wp-admin7.10 ▲3.7971.59 ▲25.77
Posts /wp-admin/edit.php7.17 ▲3.8180.04 ▲33.41
Add New Post /wp-admin/post-new.php10.60 ▲4.71128.87 ▲26.13
Media Library /wp-admin/upload.php6.97 ▲3.7366.71 ▲34.69
Dashboard /wp-admin/edit.php?post_type=web-story&page=stories-dashboard9.1676.25
Categories /wp-admin/edit-tags.php?taxonomy=web_story_category&post_type=web-story6.9659.84
All Stories /wp-admin/edit.php?post_type=web-story7.0763.52
Add New /wp-admin/post-new.php?post_type=web-story9.60100.00
Tags /wp-admin/edit-tags.php?taxonomy=web_story_tag&post_type=web-story6.9664.46

Server storage [IO: ▲17.20MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 1,638 new files
Database: no new tables, 9 new options
New WordPress options
web_stories_db_version
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_web_stories_widget
web_stories_previous_db_version
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Web Stories
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,896 ▲13415.99 ▲1.711.58 ▼0.1840.65 ▼4.99
Dashboard /wp-admin2,297 ▲1207.51 ▲1.93210.18 ▲116.6241.20 ▼1.70
Posts /wp-admin/edit.php2,223 ▲1266.26 ▲4.2670.09 ▲32.8536.29 ▼0.44
Add New Post /wp-admin/post-new.php1,534 ▲821.37 ▼1.79713.50 ▲24.2739.36 ▼24.96
Media Library /wp-admin/upload.php1,592 ▲1928.48 ▲4.27122.37 ▲14.5541.01 ▼1.83
Dashboard /wp-admin/edit.php?post_type=web-story&page=stories-dashboard1,65016.13205.18114.69
Categories /wp-admin/edit-tags.php?taxonomy=web_story_category&post_type=web-story1,3915.9452.4430.39
All Stories /wp-admin/edit.php?post_type=web-story1,1721.9032.9330.79
Explore Templates /wp-admin/edit.php?post_type=web-story&page=stories-dashboard#/templates-gallery1,65015.97208.5958.02
Add New /wp-admin/post-new.php?post_type=web-story1,72119.84875.9955.59
Settings /wp-admin/edit.php?post_type=web-story&page=stories-dashboard#/editor-settings1,6186.10187.3248.59
Tags /wp-admin/edit-tags.php?taxonomy=web_story_tag&post_type=web-story1,3665.8658.8032.85

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/web-stories/uninstall.php+45
    Constant WEBSTORIES_PLUGIN_FILE already defined
  • The uninstall procedure has failed, leaving 9 options in the database
    • web_stories_db_version
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_web_stories_widget
    • web_stories_previous_db_version
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/web-stories/includes/templates/admin/edit-story.php
    • > /wp-content/plugins/web-stories/includes/templates/admin/dashboard.php
    • > /wp-content/plugins/web-stories/includes/templates/admin/activation-notice.php
    • > /wp-content/plugins/web-stories/includes/templates/admin/experiments.php
  • 1234× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Web_Stories_Dependencies\\AmpProject\\Validator\\Spec\\TagWithExtensionSpec' not found in wp-content/plugins/web-stories/third-party/vendor/ampproject/amp-toolbox/src/Validator/Spec/Tag/ScriptAmpMustache.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Web_Stories_Dependencies\\AmpProject\\Validator\\Spec\\Tag' not found in wp-content/plugins/web-stories/third-party/vendor/ampproject/amp-toolbox/src/Validator/Spec/Tag/AmpBrightcove.php:30
    • > PHP Fatal error
      Uncaught Error: Interface 'Google\\Web_Stories_Dependencies\\AmpProject\\Optimizer\\Error' not found in wp-content/plugins/web-stories/third-party/vendor/ampproject/amp-toolbox/src/Optimizer/Error/CannotPerformServerSideRendering.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Google\\Web_Stories_Dependencies\\Sabberworm\\CSS\\Renderable' not found in wp-content/plugins/web-stories/third-party/vendor/sabberworm/php-css-parser/src/RuleSet/RuleSet.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Web_Stories_Dependencies\\AmpProject\\Validator\\Spec\\Tag' not found in wp-content/plugins/web-stories/third-party/vendor/ampproject/amp-toolbox/src/Validator/Spec/Tag/AmpImg.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Web_Stories_Dependencies\\AmpProject\\Validator\\Spec\\CssRuleset' not found in wp-content/plugins/web-stories/third-party/vendor/ampproject/amp-toolbox/src/Validator/Spec/CssRuleset/AmpNoTransformed.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Web_Stories_Dependencies\\AmpProject\\Validator\\Spec\\Tag' not found in wp-content/plugins/web-stories/third-party/vendor/ampproject/amp-toolbox/src/Validator/Spec/Tag/Datalist.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Google\\Web_Stories_Dependencies\\AmpProject\\RemoteGetRequest' not found in wp-content/plugins/web-stories/third-party/vendor/ampproject/amp-wp/src/RemoteRequest/CachedRemoteGetRequest.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Web_Stories_Dependencies\\AmpProject\\Validator\\Spec\\Tag' not found in wp-content/plugins/web-stories/third-party/vendor/ampproject/amp-toolbox/src/Validator/Spec/Tag/MetaNameAmpToAmpNavigation.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Attachments_Controller' not found in wp-content/plugins/web-stories/includes/REST_API/Stories_Media_Controller.php:53

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/edit.php?post_type=web-story&page=stories-dashboard
    • > Javascript (severe) in unknown
    /wp-admin/edit.php?post_type=web-story&page=stories-dashboard 209 Access to image at 'http://1.gravatar.com/avatar/dda8de772f53e64b26129d7f632ad1a3?s=26&d=mm&r=g' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=web-story&page=stories-dashboard#/editor-settings
    • > Network (severe)
    http://1.gravatar.com/avatar/dda8de772f53e64b26129d7f632ad1a3?s=26&d=mm&r=g - Failed to load resource: net::ERR_FAILED
    • > GET request to /wp-admin/edit.php?post_type=web-story
    • > Javascript (severe) in unknown
    /wp-admin/edit.php?post_type=web-story 301 Access to image at 'http://1.gravatar.com/avatar/dda8de772f53e64b26129d7f632ad1a3?s=26&d=mm&r=g' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    • > GET request to /wp-admin/edit.php?post_type=web-story&page=stories-dashboard#/templates-gallery
    • > Javascript (severe) in unknown
    /wp-admin/edit.php?post_type=web-story&page=stories-dashboard#/templates-gallery 209 Access to image at 'http://1.gravatar.com/avatar/dda8de772f53e64b26129d7f632ad1a3?s=26&d=mm&r=g' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    • > GET request to /wp-admin/post-new.php?post_type=web-story
    • > Other (severe) in unknown
    /wp-admin/post-new.php?post_type=web-story 0 The Cross-Origin-Opener-Policy header has been ignored, because the URL's origin was untrustworthy. It was defined either in the final response or a redirect. Please deliver the response using the HTTPS protocol. You can also use the 'localhost' origin instead. See https://www.w3.org/TR/powerful-features/#potentially-trustworthy-origin and https://html.spec.whatwg.org/#the-cross-origin-opener-policy-header.
    • > GET request to /wp-admin/post-new.php?post_type=web-story
    • > Javascript (severe) in unknown
    /wp-admin/post-new.php?post_type=web-story 1709 Access to image at 'http://1.gravatar.com/avatar/dda8de772f53e64b26129d7f632ad1a3?s=26&d=mm&r=g' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    • > GET request to /wp-admin/edit.php?post_type=web-story&page=stories-dashboard#/editor-settings
    • > Javascript (severe) in unknown
    /wp-admin/edit.php?post_type=web-story&page=stories-dashboard#/editor-settings 209 Access to image at 'http://1.gravatar.com/avatar/dda8de772f53e64b26129d7f632ad1a3?s=26&d=mm&r=g' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: stories, web stories, amp, google, storytelling

web-stories/web-stories.php Passed 13 tests

The main file in "Web Stories" v. 1.35.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
34 characters long description:
Visual storytelling for WordPress.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin106,328 lines of code in 1,620 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,4356,85763,69758,527
JSON30047,371
JavaScript15809403
CSS240127

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity5.43
▷ Minimum class complexity1.00
▷ Maximum class complexity491.00
Average method complexity3.21
▷ Minimum method complexity1.00
▷ Maximum method complexity59.00
Code structure
Namespaces74
Interfaces63
Traits4
Classes1,323
▷ Abstract classes312.34%
▷ Concrete classes1,29297.66%
▷ Final classes1,09084.37%
Methods2,658
▷ Static methods46017.31%
▷ Public methods2,01975.96%
▷ Protected methods2609.78%
▷ Private methods37914.26%
Functions161
▷ Named functions6238.51%
▷ Anonymous functions9961.49%
Constants5,114
▷ Global constants180.35%
▷ Class constants5,09699.65%
▷ Public constants5,09299.92%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin