84% wp-storymap

Code Review | Wordpress StoryMap Plugin

WordPress plugin Wordpress StoryMap Plugin scored84%from 54 tests.

About plugin

  • Plugin page: wp-storymap
  • Plugin version: 2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Aug 28, 2018
  • Latest release: Jul 23, 2023
  • Number of updates: 83
  • Update frequency: every 21.6 days
  • Top authors: josepsitjar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,101 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.06MB] [CPU: ▲54.55ms] Passed 4 tests

This is a short check of server-side resources used by Wordpress StoryMap Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2697.35 ▲55.92
Dashboard /wp-admin3.35 ▲0.05102.98 ▲55.60
Posts /wp-admin/edit.php3.47 ▲0.12111.11 ▲66.86
Add New Post /wp-admin/post-new.php5.94 ▲0.05136.15 ▲39.81
Media Library /wp-admin/upload.php3.26 ▲0.03108.35 ▲74.41
Add New Point /wp-admin/admin.php?page=storymap-pro-edit-points3.3091.49
List of Stories /wp-admin/admin.php?page=storymap-pro-mystories-list3.2689.59
StoryMap /wp-admin/admin.php?page=storymap-pro-config3.2588.37
Add New Story /wp-admin/admin.php?page=storymap-pro-edit-stories3.2988.93
List of Points /wp-admin/admin.php?page=storymap-pro-points-list3.2687.63

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 102 new files
Database: 2 new tables, 9 new options
New tables
wp_storymap_pro_points
wp_storymap_pro_my_stories
New WordPress options
widget_recent-comments
can_compress_scripts
storymap_pro_example_db_version
storymap_pro_options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
storymap_pro_stories_db_version
widget_recent-posts

Browser metrics Passed 4 tests

Wordpress StoryMap Plugin: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,295 ▲56017.10 ▲2.8121.30 ▲19.4246.10 ▼4.62
Dashboard /wp-admin2,384 ▲1966.50 ▲1.62137.93 ▲22.7746.66 ▲0.13
Posts /wp-admin/edit.php2,290 ▲2013.35 ▲1.3154.48 ▲17.7135.07 ▲3.49
Add New Post /wp-admin/post-new.php1,700 ▲16520.10 ▼3.38624.50 ▼55.9530.45 ▼33.86
Media Library /wp-admin/upload.php1,426 ▲354.14 ▲0.0281.10 ▼26.3444.32 ▲0.26
Add New Point /wp-admin/admin.php?page=storymap-pro-edit-points4,6509.30216.4995.00
List of Stories /wp-admin/admin.php?page=storymap-pro-mystories-list1,1693.1938.2726.95
StoryMap /wp-admin/admin.php?page=storymap-pro-config1,0123.1536.9525.68
Add New Story /wp-admin/admin.php?page=storymap-pro-edit-stories1,6046.30109.7842.73
List of Points /wp-admin/admin.php?page=storymap-pro-points-list1,1893.1337.4327.37

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 9 options
    • storymap_pro_stories_db_version
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • storymap_pro_example_db_version
    • storymap_pro_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/wp-storymap/my-stories.php:75
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/wp-storymap/wp-storymap-pro.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/wp-storymap/points-table.php:84

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% 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
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #5 (Page with all your points and related info.), #6 (How to insert a story in a page or post.), #7 (Storymap public view.)
You can look at the official readme.txt

wp-storymap/wp-storymap-pro.php 92% from 13 tests

The entry point to "Wordpress StoryMap Plugin" version 2.1 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-storymap.php" instead of "wp-storymap-pro.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin34,160 lines of code in 70 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript175,5106,88022,605
CSS13120983,624
SVG2112,893
LESS17731122,066
Sass1434341,768
PHP42934161,135
Markdown110040
HTML16428
JSON1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity10.50
▷ Minimum class complexity10.00
▷ Maximum class complexity11.00
Average method complexity1.76
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions35
▷ Named functions35100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
15 compressed PNG files occupy 0.37MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
leaflet/images/marker-icon-2x.png2.41KB2.52KB0.00%
leaflet-storymap-master/markers/images/circle.png1.00KB0.76KB▼ 23.90%
leaflet/images/layers-2x.png1.23KB1.67KB0.00%
leaflet/images/layers.png0.68KB1.05KB0.00%
leaflet-storymap-master/markers/images/markers_shadow@2x.png1.43KB1.56KB0.00%