10% nikeplus

Code Review | Nike+

WordPress plugin Nike+ scored10%from 54 tests.

About plugin

  • Plugin page: nikeplus
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-3.9
  • WordPress version: 6.3.1
  • First release: Sep 16, 2012
  • Latest release: Apr 9, 2014
  • Number of updates: 16
  • Update frequency: every 35.6 days
  • Top authors: jameslaws (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /2,806 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/nikeplus/functions/list-runs.php+301
    Function create_function() is deprecated

Server metrics [RAM: ▼1.78MB] [CPU: ▼55.86ms] Passed 4 tests

This is a short check of server-side resources used by Nike+
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.21 ▼1.255.95 ▼38.53
Dashboard /wp-admin2.23 ▼1.078.31 ▼38.92
Posts /wp-admin/edit.php2.23 ▼1.138.69 ▼44.85
Add New Post /wp-admin/post-new.php2.23 ▼3.666.75 ▼101.14
Media Library /wp-admin/upload.php2.23 ▼1.0010.84 ▼23.77
Nike+ Settings /wp-admin/edit.php?post_type=nikeplus_runs&page=nikeplus2.236.67
Nike+ Runs /wp-admin/edit.php?post_type=nikeplus_runs2.238.20

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 18 new files
Database: no new tables, 11 new options
New WordPress options
can_compress_scripts
widget_nikeplus_individual_totals
widget_recent-comments
widget_nikeplus_personal_records
nikeplus_options
widget_nikeplus_list_runs
widget_theysaidso_widget
db_upgraded
widget_nikeplus_team_totals
theysaidso_admin_options
...

Browser metrics Passed 4 tests

Nike+: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,854 ▲9713.23 ▼1.121.77 ▼0.2738.54 ▼11.72
Dashboard /wp-admin2,229 ▲415.84 ▲0.01109.85 ▲3.4287.55 ▲42.49
Posts /wp-admin/edit.php2,115 ▲261.99 ▼0.0238.03 ▼4.2436.30 ▼1.55
Add New Post /wp-admin/post-new.php1,537 ▲317.57 ▼5.51725.92 ▲117.1969.28 ▲6.12
Media Library /wp-admin/upload.php1,414 ▲264.13 ▼0.09123.09 ▲15.1352.48 ▲9.05
Nike+ Settings /wp-admin/edit.php?post_type=nikeplus_runs&page=nikeplus8552.0329.1129.57
Nike+ Runs /wp-admin/edit.php?post_type=nikeplus_runs1,0891.9530.2431.07

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/nikeplus/functions/list-runs.php+301
    Function create_function() is deprecated
  • Zombie WordPress options were found after uninstall: 11 options
    • widget_nikeplus_individual_totals
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • nikeplus_options
    • can_compress_scripts
    • widget_nikeplus_team_totals
    • widget_nikeplus_list_runs
    • widget_nikeplus_personal_records
    • widget_recent-posts
    • ...

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)
Please fix the following server-side errors
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=nikeplus_runs
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/nikeplus/functions/team-totals.php+252
    Function create_function() is deprecated
    • > GET request to /wp-admin/edit.php?post_type=nikeplus_runs&page=nikeplus
    • > Notice in wp-content/plugins/nikeplus/options/options.php+18
    Undefined index: settings-updated
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=nikeplus_runs&page=nikeplus
    • > Warning in wp-content/plugins/nikeplus/options/options.php+177
    Illegal string offset 'update_frequency'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=nikeplus_runs&page=nikeplus
    • > Warning in wp-content/plugins/nikeplus/options/options.php+153
    Cannot assign an empty string to a string offset
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=nikeplus_runs&page=nikeplus
    • > Notice in wp-content/plugins/nikeplus/options/options.php+157
    Uninitialized string offset: 0
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=nikeplus_runs&page=nikeplus
    • > Warning in wp-content/plugins/nikeplus/options/options.php+157
    Illegal string offset 'distance_unit'

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 11× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/nikeplus/options/options.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/nikeplus/nikeplus.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/nikeplus/functions/personal-records.php:175
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/nikeplus/functions/team-totals.php:126
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/nikeplus/functions/individual-totals.php:169
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/nikeplus/functions/list-runs.php:170
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/nikeplus/nikeplus.php on line 15
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/nikeplus/nikeplus.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/nikeplus/functions/post-type.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/nikeplus/functions/nike-data.php:133

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: running, shortcode, widget, nike plus, nike

nikeplus/nikeplus.php Passed 13 tests

The primary PHP file in "Nike+" version 1.1 is used by WordPress to initiate all plugin functionality
100 characters long description:
This plugin allows you to display your Nike PLus run stats on your website via widgets or shortcodes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin2,042 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP133277612,017
CSS10422
Markdown1103

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity12.38
▷ Minimum class complexity4.00
▷ Maximum class complexity23.00
Average method complexity2.05
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods87
▷ Static methods00.00%
▷ Public methods7990.80%
▷ Protected methods00.00%
▷ Private methods89.20%
Functions45
▷ Named functions45100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/sneaker.png1.23KB0.56KB▼ 54.44%
img/nikeplus-sprite.png6.80KB4.25KB▼ 37.47%