79% whereabouts-swarm

Code Review | Whereabouts: Swarm

WordPress plugin Whereabouts: Swarm scored79%from 54 tests.

About plugin

  • Plugin page: whereabouts-swarm
  • Plugin version: 0.5.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.5
  • WordPress version: 6.3.1
  • First release: Nov 6, 2015
  • Latest release: Sep 28, 2020
  • Number of updates: 16
  • Update frequency: every 111.8 days
  • Top authors: florianziegler (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /2,290 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼0.61ms] Passed 4 tests

This is a short check of server-side resources used by Whereabouts: Swarm
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1045.94 ▲4.06
Dashboard /wp-admin3.45 ▲0.1571.14 ▲16.78
Posts /wp-admin/edit.php3.43 ▲0.0752.31 ▲1.61
Add New Post /wp-admin/post-new.php5.96 ▲0.0790.50 ▼8.57
Media Library /wp-admin/upload.php3.30 ▲0.0735.44 ▲0.48
Whereabouts: Swarm /wp-admin/options-general.php?page=whereabouts_swarm3.2432.44

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

Browser metrics Passed 4 tests

An overview of browser requirements for Whereabouts: Swarm
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲1114.35 ▼0.031.78 ▼0.5841.56 ▼3.91
Dashboard /wp-admin2,200 ▲235.64 ▼0.0684.00 ▼17.2840.09 ▼1.53
Posts /wp-admin/edit.php2,108 ▲82.01 ▼0.0139.90 ▲2.3535.02 ▼3.68
Add New Post /wp-admin/post-new.php1,533 ▼1517.64 ▼5.54682.95 ▲7.5760.43 ▼7.50
Media Library /wp-admin/upload.php1,405 ▲84.23 ▲0.0999.95 ▼18.2744.80 ▼3.67
Whereabouts: Swarm /wp-admin/options-general.php?page=whereabouts_swarm9102.0222.8628.79

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_whereabouts_swarm_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=whereabouts_swarm
    • > Notice in wp-content/plugins/whereabouts-swarm/whereabouts-swarm.php+165
    Trying to access array offset on value of type bool

SRP 50% 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
Please take a closer look at the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/whereabouts-swarm/includes/display-location.php:98
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/whereabouts-swarm/includes/widget.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/whereabouts-swarm/includes/get-location.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
9 plugin tags: digitalnomad, timezone, location, swarm, travel...

whereabouts-swarm/whereabouts-swarm.php Passed 13 tests

The primary PHP file in "Whereabouts: Swarm" version 0.5.0 is used by WordPress to initiate all plugin functionality
83 characters long description:
Display your current location, automatically updated by your latest Swarm check-in.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin282 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP4117101280
CSS1011
JavaScript1001

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.51
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
1 compressed PNG file occupies 0.01MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/swarm-logo.png5.38KB4.99KB▼ 7.20%