10% runtastic-widget

Code Review | Runtastic Widget

WordPress plugin Runtastic Widget scored10%from 54 tests.

About plugin

  • Plugin page: runtastic-widget
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.1-4.1
  • WordPress version: 6.3.1
  • First release: Aug 26, 2014
  • Latest release: Nov 16, 2016
  • Number of updates: 18
  • Update frequency: every 45.2 days
  • Top authors: danielpapenfuss (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,520 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/runtastic-widget/runtastic.php+25
    Methods with the same name as their class will not be constructors in a future version of PHP; Runtastic_Widget has a deprecated constructor

Server metrics [RAM: ▼1.92MB] [CPU: ▼55.06ms] Passed 4 tests

Server-side resources used by Runtastic Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.385.56 ▼34.04
Dashboard /wp-admin2.10 ▼1.2511.70 ▼44.45
Posts /wp-admin/edit.php2.10 ▼1.265.65 ▼37.63
Add New Post /wp-admin/post-new.php2.10 ▼3.796.17 ▼104.11
Media Library /wp-admin/upload.php2.10 ▼1.136.70 ▼25.04

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 22 new files
Database: 1 new table, 7 new options
New tables
wp_RuntasticWidgetCache
New WordPress options
widget_recent-posts
widget_runtastic_widget_id
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Runtastic Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.57 ▼1.114.48 ▲2.8244.62 ▲6.94
Dashboard /wp-admin2,206 ▲174.86 ▼1.06113.33 ▼9.1343.20 ▼5.88
Posts /wp-admin/edit.php2,089 ▲32.05 ▲0.0536.10 ▲0.2633.46 ▼1.23
Add New Post /wp-admin/post-new.php1,519 ▼1723.20 ▼0.11630.68 ▼9.8154.29 ▲4.77
Media Library /wp-admin/upload.php1,382 ▼04.18 ▼0.0592.34 ▼8.0140.92 ▼0.94

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/runtastic-widget/runtastic.php+25
    Methods with the same name as their class will not be constructors in a future version of PHP; Runtastic_Widget has a deprecated constructor
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_runtastic_widget_id
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Almost there! Just fix the following items
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/runtastic-widget/anzeige_Englisch.php
    • > /wp-content/plugins/runtastic-widget/anzeige.php
    • > /wp-content/plugins/runtastic-widget/credentials.php
    • > /wp-content/plugins/runtastic-widget/anzeige_Deutsch.php
  • 47× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/runtastic-widget/anzeige.php on line 23
    • > PHP Notice
      Undefined variable: LastActivity in wp-content/plugins/runtastic-widget/anzeige_Deutsch.php on line 22
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/runtastic-widget/anzeige.php on line 15
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/runtastic-widget/anzeige_Deutsch.php on line 22
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/runtastic-widget/anzeige_Deutsch.php on line 3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/runtastic-widget/Update_Cache.php:2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/runtastic-widget/anzeige.php on line 19
    • > PHP Notice
      Undefined variable: LastActivity in wp-content/plugins/runtastic-widget/anzeige_Englisch.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/runtastic-widget/anzeige_Deutsch.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/runtastic-widget/runtastic.php:12

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 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
3 plugin tags: fitness widget, runtastic widget, runtastic

runtastic-widget/runtastic.php 92% from 13 tests

The principal PHP file in "Runtastic Widget" v. 1.4 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("runtastic-widget.php" instead of "runtastic.php")

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 detected1,106 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP1210350755
PO File4144262337
CSS11014

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity13.50
▷ Minimum class complexity3.00
▷ Maximum class complexity29.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods35
▷ Static methods00.00%
▷ Public methods2777.14%
▷ Protected methods00.00%
▷ Private methods822.86%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin