84% trakttv-widget

Code Review | Trakt.tv Widget

WordPress plugin Trakt.tv Widget scored84%from 54 tests.

About plugin

  • Plugin page: trakttv-widget
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.7
  • WordPress version: 6.3.1
  • First release: Sep 30, 2013
  • Latest release: Oct 1, 2013
  • Number of updates: 3
  • Update frequency: every 0.7 days
  • Top authors: jshreve (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,243 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by Trakt.tv Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.17 ▲1.29
Dashboard /wp-admin3.34 ▼0.0143.12 ▼17.30
Posts /wp-admin/edit.php3.39 ▲0.0344.86 ▼14.20
Add New Post /wp-admin/post-new.php5.92 ▲0.0383.93 ▼12.22
Media Library /wp-admin/upload.php3.26 ▲0.0331.99 ▼4.29

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_television_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Trakt.tv Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.29 ▼1.235.02 ▲3.0644.14 ▲2.99
Dashboard /wp-admin2,206 ▲245.88 ▲0.94103.32 ▲0.4639.15 ▼2.37
Posts /wp-admin/edit.php2,092 ▲62.14 ▲0.1434.40 ▼1.7332.44 ▼3.30
Add New Post /wp-admin/post-new.php1,533 ▼923.12 ▲4.94667.07 ▲41.8449.96 ▼15.23
Media Library /wp-admin/upload.php1,388 ▼04.16 ▼0.0394.55 ▼5.7442.27 ▼2.27

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
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_television_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% 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 everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/trakttv-widget/tv-widget.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Screenshot #1 (An example of the widget output.) image missing
Please take inspiration from this readme.txt

trakttv-widget/tv-widget.php 92% from 13 tests

"Trakt.tv Widget" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("trakttv-widget.php" instead of "tv-widget.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
Success! There were no dangerous files found in this plugin119 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1202699
CSS13020

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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
1 PNG file occupies 0.17MB with 0.11MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png173.71KB57.76KB▼ 66.75%