83% wp-strava

Code Review | WP-Strava

WordPress plugin WP-Strava scored83%from 54 tests.

About plugin

  • Plugin page: wp-strava
  • Plugin version: 2.12.1
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.1
  • WordPress version: 6.3.1
  • First release: Apr 10, 2013
  • Latest release: Nov 25, 2022
  • Number of updates: 129
  • Update frequency: every 27.3 days
  • Top authors: jrfoell (90.7%)cmanon (9.3%)lancewillett (1.55%)

Code review

54 tests

User reviews

12 reviews

Install metrics

1,000+ active /48,745 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.35MB] [CPU: ▼7.34ms] Passed 4 tests

An overview of server-side resources used by WP-Strava
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.85 ▲0.3844.23 ▲8.20
Dashboard /wp-admin3.70 ▲0.3545.68 ▼14.14
Posts /wp-admin/edit.php3.75 ▲0.3945.53 ▼3.38
Add New Post /wp-admin/post-new.php6.23 ▲0.3483.46 ▼17.27
Media Library /wp-admin/upload.php3.56 ▲0.3237.67 ▲5.45
Strava /wp-admin/options-general.php?page=wp-strava-options3.5335.82

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 65 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
widget_wpstrava_latestmapwidget
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_wp-strava
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for WP-Strava
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.55 ▼1.041.83 ▲0.1942.73 ▲1.59
Dashboard /wp-admin2,207 ▲225.83 ▼0.0594.76 ▼7.5039.68 ▼3.17
Posts /wp-admin/edit.php2,096 ▲72.04 ▲0.0337.14 ▼3.8431.80 ▼3.46
Add New Post /wp-admin/post-new.php6,185 ▲4,67119.09 ▲1.56895.28 ▲279.4473.52 ▲14.04
Media Library /wp-admin/upload.php1,392 ▲44.20 ▲0.0097.92 ▼6.7742.01 ▼0.34
Strava /wp-admin/options-general.php?page=wp-strava-options1,0902.0424.1930.05

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • db_upgraded
    • widget_wpstrava_latestmapwidget
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_wp-strava
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 14× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'WPStrava_Blocks_Interface' not found in wp-content/plugins/wp-strava/src/WPStrava/Blocks/Route.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'WPStrava_Blocks_Interface' not found in wp-content/plugins/wp-strava/src/WPStrava/Blocks/Segment.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'WPStrava_Blocks_Interface' not found in wp-content/plugins/wp-strava/src/WPStrava/Blocks/ActivitiesList.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WPStrava_StaticMap' not found in wp-content/plugins/wp-strava/src/WPStrava/StaticGMap.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/wp-strava/wp-strava.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'WPStrava_SOM' not found in wp-content/plugins/wp-strava/src/WPStrava/SOMMetric.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-strava/src/WPStrava/ActivitiesListWidget.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-strava/src/WPStrava/LatestMapWidget.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WPStrava_SOM' not found in wp-content/plugins/wp-strava/src/WPStrava/SOMEnglish.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'WPStrava_Blocks_Interface' not found in wp-content/plugins/wp-strava/src/WPStrava/Blocks/Activity.php:6

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, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 17 tag instead of maximum 10
The official readme.txt might help

wp-strava/wp-strava.php 85% from 13 tests

Analyzing the main PHP file in "WP-Strava" version 2.12.1
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 180 characters long)
  • Domain Path: The domain path is invalid: folder "/lang" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin3,440 lines of code in 61 files:
LanguageFilesBlank linesComment linesLines of code
PHP395401,6532,305
JavaScript148225647
CSS42016380
JSON400108

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity8.00
▷ Minimum class complexity1.00
▷ Maximum class complexity52.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes36
▷ Abstract classes616.67%
▷ Concrete classes3083.33%
▷ Final classes00.00%
Methods194
▷ Static methods136.70%
▷ Public methods16987.11%
▷ Protected methods126.19%
▷ Private methods136.70%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants46
▷ Global constants613.04%
▷ Class constants4086.96%
▷ Public constants40100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.65MB with 0.16MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/blocks/activity/activity.png271.14KB271.62KB0.00%
images/fugue-sprite.png122.23KB33.22KB▼ 72.82%
images/example-activity.png271.14KB271.62KB0.00%