78% tfl-widgets

Code Review | TFL Widgets

WordPress plugin TFL Widgets scored78%from 54 tests.

About plugin

  • Plugin page: tfl-widgets
  • Plugin version: 1.2
  • PHP compatiblity: 5.6.32+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.8-5.2.2
  • WordPress version: 6.3.1
  • First release: Apr 12, 2017
  • Latest release: Aug 2, 2019
  • Number of updates: 14
  • Update frequency: every 60.5 days
  • Top authors: jelnet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /923 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

Analyzing server-side resources used by TFL Widgets
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0239.03 ▼1.32
Dashboard /wp-admin3.32 ▲0.0248.93 ▼0.15
Posts /wp-admin/edit.php3.37 ▲0.0252.56 ▲0.22
Add New Post /wp-admin/post-new.php5.90 ▲0.0287.22 ▼5.55
Media Library /wp-admin/upload.php3.24 ▲0.0236.25 ▼1.46

Server storage [IO: ▲0.05MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_jel_tfl_wp_widget
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for TFL Widgets
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▼0.271.82 ▲0.2537.41 ▼6.13
Dashboard /wp-admin2,198 ▲185.62 ▼0.0287.81 ▲3.9144.15 ▲1.20
Posts /wp-admin/edit.php2,103 ▲31.94 ▼0.0534.81 ▼10.0836.57 ▼1.96
Add New Post /wp-admin/post-new.php1,526 ▼022.99 ▼0.26655.90 ▼24.4768.14 ▲14.65
Media Library /wp-admin/upload.php1,403 ▲64.20 ▲0.0096.68 ▼14.2743.20 ▼1.99

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_jel_tfl_wp_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

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
Please fix the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/tfl-widgets/public/partials/jel-tfl-widgets-public-display.php
    • > /wp-content/plugins/tfl-widgets/admin/partials/jel-tfl-widgets-admin-display.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/tfl-widgets/includes/class-jel-tfl-widgets-wp-widget.php:26

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)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
9 plugin tags: transport for london, london underground, tube, tube map, tfl widgets...

tfl-widgets/jel-tfl-widgets.php 92% from 13 tests

Analyzing the main PHP file in "TFL Widgets" version 1.2
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("tfl-widgets.php" instead of "jel-tfl-widgets.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin248 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP13154574242
JavaScript24546
CSS2080

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity2.88
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity1.47
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods32
▷ Static methods26.25%
▷ Public methods2784.38%
▷ Protected methods00.00%
▷ Private methods515.62%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG files were detected