10% custom-strava-integration

Code Review | Custom Strava Integration

WordPress plugin Custom Strava Integration scored10%from 54 tests.

About plugin

  • Plugin page: custom-strava-int...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.3.1
  • WordPress version: 6.3.1
  • First release: Sep 26, 2015
  • Latest release: Sep 30, 2015
  • Number of updates: 9
  • Update frequency: every 0.7 days
  • Top authors: floriankimmel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,648 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/custom-strava-integration/custom-strava-integration.php+23
    Undefined variable: html

Server metrics [RAM: ▼0.02MB] [CPU: ▼6.66ms] Passed 4 tests

Server-side resources used by Custom Strava Integration
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0741.96 ▲1.36
Dashboard /wp-admin3.40 ▲0.1045.53 ▼3.96
Posts /wp-admin/edit.php3.51 ▲0.1657.31 ▲7.90
Add New Post /wp-admin/post-new.php5.53 ▼0.3575.60 ▼24.83
Media Library /wp-admin/upload.php3.32 ▲0.0938.65 ▲0.81
Custom Strava Integration /wp-admin/options-general.php?page=strava_for_wp_admin3.3334.54

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
strava_settings
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Custom Strava Integration
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3314.44 ▲0.061.75 ▼0.1241.29 ▼1.62
Dashboard /wp-admin2,213 ▲214.83 ▼0.11102.75 ▼9.2139.95 ▼0.28
Posts /wp-admin/edit.php2,093 ▲72.06 ▲0.0637.97 ▲0.7640.15 ▲7.11
Add New Post /wp-admin/post-new.php6,328 ▲4,79119.38 ▼3.96936.02 ▲266.5562.16 ▲2.21
Media Library /wp-admin/upload.php1,389 ▲14.14 ▼0.0799.04 ▼5.9649.42 ▲7.09
Custom Strava Integration /wp-admin/options-general.php?page=strava_for_wp_admin1,3926.02129.1264.90

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • db_upgraded
    • strava_settings
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
  • 9× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      require_once(): Failed opening required 'STRAVA_FOR_WP_PLUGIN_DIRlibs/StravaApi.php' (include_path='.:/usr/share/php') in wp-content/plugins/custom-strava-integration/custom-strava-integration-shortcode.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/custom-strava-integration/custom-strava-integration.php:10
    • > PHP Warning
      Use of undefined constant STRAVA_FOR_WP_PLUGIN_DIR - assumed 'STRAVA_FOR_WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-strava-integration/custom-strava-integration-shortcode.php on line 2
    • > PHP Warning
      require_once(STRAVA_FOR_WP_PLUGIN_DIRlibs/StravaApi.php): failed to open stream: No such file or directory in wp-content/plugins/custom-strava-integration/custom-strava-integration-metabox.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'STRAVA_FOR_WP_PLUGIN_DIRlibs/StravaApi.php' (include_path='.:/usr/share/php') in wp-content/plugins/custom-strava-integration/custom-strava-integration-metabox.php on line 3
    • > PHP Warning
      Use of undefined constant STRAVA_FOR_WP_PLUGIN_DIR - assumed 'STRAVA_FOR_WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-strava-integration/custom-strava-integration-metabox.php on line 3
    • > PHP Warning
      Use of undefined constant STRAVA_FOR_WP_PLUGIN_URL - assumed 'STRAVA_FOR_WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-strava-integration/custom-strava-integration-admin.php on line 2
    • > PHP Warning
      require_once(STRAVA_FOR_WP_PLUGIN_DIRlibs/StravaApi.php): failed to open stream: No such file or directory in wp-content/plugins/custom-strava-integration/custom-strava-integration-shortcode.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function home_url() in wp-content/plugins/custom-strava-integration/custom-strava-integration-admin.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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
These attributes need your attention:
  • Donate link: Please fix this invalid url: ""
Please take inspiration from this readme.txt

custom-strava-integration/custom-strava-integration.php 92% from 13 tests

"Custom Strava Integration" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 209 characters long)

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
No dangerous file extensions were detected508 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP7151139508

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.43
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods1071.43%
▷ Protected methods428.57%
▷ Private methods00.00%
Functions28
▷ Named functions28100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants480.00%
▷ Class constants120.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/ConnectWithStrava.png4.04KB1.92KB▼ 52.50%