84% widgets-for-thingspeak

Code Review | Widgets for Thingspeak

WordPress plugin Widgets for Thingspeak scored 84% from 54 tests.

About plugin

  • Plugin page: widgets-for-thing...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.5.2
  • WordPress version: 6.3.1
  • First release: Jun 15, 2016
  • Latest release: Jun 15, 2016
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: schmiddim (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 1,099 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
Install script ran successfully

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

A check of server-side resources used by Widgets for Thingspeak
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.03 ▲1.58
Dashboard /wp-admin3.32 ▲0.0245.93 ▲0.62
Posts /wp-admin/edit.php3.43 ▲0.0841.98 ▼7.14
Add New Post /wp-admin/post-new.php5.90 ▲0.0181.19 ▼10.09
Media Library /wp-admin/upload.php3.24 ▲0.0134.78 ▲2.88

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Widgets for Thingspeak
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.20 ▼1.191.85 ▲0.1438.34 ▼4.17
Dashboard /wp-admin2,209 ▲234.85 ▼0.1199.91 ▼21.3438.05 ▼6.06
Posts /wp-admin/edit.php2,089 ▼02.00 ▲0.0336.23 ▲2.3134.86 ▲0.48
Add New Post /wp-admin/post-new.php1,533 ▼023.08 ▼0.13634.98 ▼40.1962.54 ▲2.25
Media Library /wp-admin/upload.php1,385 ▼34.23 ▼0.0193.80 ▼0.3041.55 ▼0.70

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_thingspeak_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'Schmiddim\\Widget\\AbstractWidget' not found in wp-content/plugins/widgets-for-thingspeak/src/Schmiddim/Thingspeak/Widget.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/widgets-for-thingspeak/src/Schmiddim/Widget/AbstractWidget.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/widgets-for-thingspeak/ts-widget.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
1 plugin tags: thingspeak

widgets-for-thingspeak/ts-widget.php 92% from 13 tests

"Widgets for Thingspeak" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("widgets-for-thingspeak.php" instead of "ts-widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected419 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP9119224401
JSON21018

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity13.00
▷ Minimum class complexity2.00
▷ Maximum class complexity39.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods33
▷ Static methods26.06%
▷ Public methods3296.97%
▷ Protected methods00.00%
▷ Private methods13.03%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin