79% wp-story

Code Review | WP Story

WordPress plugin WP Story scored79%from 54 tests.

About plugin

  • Plugin page: wp-story
  • Plugin version: 2.1.2
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.6.2
  • WordPress version: 6.3.1
  • First release: Aug 18, 2019
  • Latest release: Feb 23, 2021
  • Number of updates: 45
  • Update frequency: every 12.5 days
  • Top authors: wpuzman (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

1,000+ active /18,683 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▼1.56ms] Passed 4 tests

An overview of server-side resources used by WP Story
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1746.38 ▲3.25
Dashboard /wp-admin3.47 ▲0.1650.62 ▼4.01
Posts /wp-admin/edit.php3.58 ▲0.2250.07 ▲1.56
Add New Post /wp-admin/post-new.php6.11 ▲0.2295.84 ▼6.95
Media Library /wp-admin/upload.php3.39 ▲0.1639.47 ▲3.18
Add New /wp-admin/post-new.php?post_type=wp-story3.4147.94
All Stories /wp-admin/edit.php?post_type=wp-story3.4341.03
Options /wp-admin/edit.php?post_type=wp-story&page=wp-story-options3.3734.91
Displayed Stories /wp-admin/edit.php?post_type=wp-story&page=wp-story3.3634.62

Server storage [IO: ▲0.38MB] [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: 32 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by WP Story
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,950 ▲17913.92 ▼0.509.71 ▲7.6438.14 ▼5.72
Dashboard /wp-admin2,237 ▲495.82 ▼0.08101.49 ▼13.9263.50 ▲21.95
Posts /wp-admin/edit.php2,129 ▲402.01 ▲0.0239.16 ▼2.3333.92 ▲1.69
Add New Post /wp-admin/post-new.php1,543 ▲1523.10 ▲4.64754.32 ▲83.3458.45 ▼2.54
Media Library /wp-admin/upload.php1,413 ▲224.24 ▲0.03100.20 ▲0.3378.76 ▲36.26
Add New /wp-admin/post-new.php?post_type=wp-story1,8053.8674.06109.53
All Stories /wp-admin/edit.php?post_type=wp-story1,0992.2033.7829.98
Options /wp-admin/edit.php?post_type=wp-story&page=wp-story-options9001.7525.4336.69
Displayed Stories /wp-admin/edit.php?post_type=wp-story&page=wp-story9101.9032.6827.41

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% 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)
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=wp-story
    • > Notice in wp-content/plugins/wp-story/admin/class-wp-story-meta-box.php+120
    Trying to access array offset on value of type int

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 server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-story/admin/class-wp-story-meta-box.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-story/admin/partials/wp-story-admin-options-display.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/wp-story/admin/partials/wp-story-admin-fields-display.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: instagram, wordpress hikaye, stories, wordpress story, story...

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

"WP Story" version 2.1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
31 characters long description:
Create your own simple stories.

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 plugin1,250 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP13197607661
CSS3581371
PO File16365145
JavaScript412373

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity5.88
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity1.85
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods46
▷ Static methods24.35%
▷ Public methods4189.13%
▷ Protected methods00.00%
▷ Private methods510.87%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/menu.png0.29KB0.20KB▼ 31.19%
admin/img/rate.png36.83KB15.38KB▼ 58.23%