68% storyftw

Code Review | story|ftw

WordPress plugin story|ftw scored 68% from 54 tests.

About plugin

  • Plugin page: storyftw
  • Plugin version: 0.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.0-4.1.1
  • WordPress version: 6.3.1
  • First release: Dec 17, 2014
  • Latest release: Feb 28, 2015
  • Number of updates: 14
  • Update frequency: every 5.4 days
  • Top authors: jtsternberg (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

40+ active / 4,904 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.36MB] [CPU: ▼35.58ms] Passed 4 tests

This is a short check of server-side resources used by story|ftw
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1519.78 ▼23.11
Dashboard /wp-admin3.65 ▲0.3523.09 ▼26.22
Posts /wp-admin/edit.php3.65 ▲0.3024.44 ▼22.02
Add New Post /wp-admin/post-new.php3.65 ▼2.2323.11 ▼70.96
Media Library /wp-admin/upload.php3.65 ▲0.4327.33 ▼9.48
Add New Story /wp-admin/post-new.php?post_type=storyftw_stories3.6622.67
All Stories /wp-admin/edit.php?post_type=storyftw_stories3.6625.54

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 100 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for story|ftw
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,855 ▲12014.47 ▲0.201.88 ▼0.0140.90 ▼6.13
Dashboard /wp-admin2,233 ▲484.87 ▲0.02100.82 ▼14.9637.45 ▼11.11
Posts /wp-admin/edit.php2,116 ▲272.06 ▲0.0736.14 ▲1.7536.36 ▲2.01
Add New Post /wp-admin/post-new.php1,577 ▲6323.64 ▲2.02671.19 ▼25.7836.37 ▼10.89
Media Library /wp-admin/upload.php1,415 ▲304.23 ▲0.0195.90 ▼11.7142.82 ▼1.80
Add New Story /wp-admin/post-new.php?post_type=storyftw_stories2,9584.62143.0750.17
All Stories /wp-admin/edit.php?post_type=storyftw_stories1,1031.9831.3025.90

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/storyftw/includes/libraries/cmb/CMB2.php+565
    count(): Parameter must be an array or an object that implements Countable
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 21 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=storyftw_stories
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/storyftw/includes/libraries/cmb/CMB2.php+565
    count(): Parameter must be an array or an object that implements Countable

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
  • 14× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/storyftw/includes/templates/story-tablenav.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/storyftw/includes/templates/index.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/storyftw/includes/templates/story-table-head-foot.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/storyftw/includes/libraries/cmb/CMB2.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/storyftw/includes/libraries/cmb/init.php:79
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/storyftw/storyftw.php:163
    • > PHP Notice
      Undefined variable: top in wp-content/plugins/storyftw/includes/templates/story-table-head-foot.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/storyftw/includes/libraries/cmb2-post-search-field/cmb2_post_search_field.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'StoryFTW' not found in wp-content/plugins/storyftw/includes/templates/story-listing.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'StoryFTW_CPT' not found in wp-content/plugins/storyftw/includes/stories.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: You are using too many tags: 16 tag instead of maximum 10
  • Screenshots: These screenshots do not have images: #1 (Replace any WordPress page with a story.), #2 (Create a story & story global settings.), #3 (Story global settings continued.), #4 (Story page re-ordering.), #5 (Embed a background image/gif or video.)
You can take inspiration from this readme.txt

storyftw/storyftw.php Passed 13 tests

Analyzing the main PHP file in "story|ftw" version 0.1.4
123 characters long description:
A full screen, mobile first, storytelling plugin for WordPress. Eliminate distractions and focus your reader on your story.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin14,066 lines of code in 69 files:
LanguageFilesBlank linesComment linesLines of code
PHP331,5612,0945,612
CSS129694814,547
JavaScript209998043,463
PO File2183357414
SVG20230

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity32.30
▷ Minimum class complexity3.00
▷ Maximum class complexity108.00
Average method complexity3.24
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes27
▷ Abstract classes00.00%
▷ Concrete classes27100.00%
▷ Final classes00.00%
Methods377
▷ Static methods174.51%
▷ Public methods37198.41%
▷ Protected methods20.53%
▷ Private methods41.06%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants125.00%
▷ Class constants375.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
19 compressed PNG files occupy 2.19MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/libraries/cmb/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
includes/libraries/cmb/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
includes/libraries/cmb/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
includes/libraries/cmb/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
includes/libraries/cmb/images/ico-delete.png0.70KB0.72KB0.00%