78% article-displayer-for-the-daily-wtf

Code Review | Article Displayer for The Daily WTF

WordPress plugin Article Displayer for The Daily WTF scored78%from 54 tests.

About plugin

  • Plugin page: article-displayer...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.5.2
  • WordPress version: 6.3.1
  • First release: May 9, 2016
  • Latest release: May 12, 2016
  • Number of updates: 12
  • Update frequency: every 0.3 days
  • Top authors: efederman22 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /660 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.03MB] [CPU: ▼0.32ms] Passed 4 tests

Analyzing server-side resources used by Article Displayer for The Daily WTF
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0742.99 ▼2.01
Dashboard /wp-admin3.34 ▲0.0351.19 ▼6.00
Posts /wp-admin/edit.php3.39 ▲0.0362.45 ▲13.49
Add New Post /wp-admin/post-new.php5.92 ▲0.03107.64 ▲1.46
Media Library /wp-admin/upload.php3.26 ▲0.0345.04 ▲5.25

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Article Displayer for The Daily WTF: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,135 ▲38914.89 ▲0.7232.29 ▲30.2941.59 ▼3.82
Dashboard /wp-admin2,192 ▲155.59 ▼0.0087.75 ▼7.9041.79 ▼5.76
Posts /wp-admin/edit.php2,104 ▲42.03 ▲0.0444.86 ▲4.5640.95 ▲4.61
Add New Post /wp-admin/post-new.php1,542 ▲13821.13 ▲2.76710.05 ▼135.1542.04 ▼17.76
Media Library /wp-admin/upload.php1,400 ▼04.22 ▲0.09121.46 ▲8.9955.06 ▲4.78

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

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)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/article-displayer-for-the-daily-wtf/views/plugin.php
  • 22× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to get property 'next_article_id' of non-object in wp-content/plugins/article-displayer-for-the-daily-wtf/views/plugin.php on line 27
    • > PHP Notice
      Trying to get property 'url' of non-object in wp-content/plugins/article-displayer-for-the-daily-wtf/views/plugin.php on line 24
    • > PHP Notice
      Trying to get property 'display_date' of non-object in wp-content/plugins/article-displayer-for-the-daily-wtf/views/plugin.php on line 41
    • > PHP Notice
      Undefined variable: article in wp-content/plugins/article-displayer-for-the-daily-wtf/views/plugin.php on line 5
    • > PHP Notice
      Trying to get property 'comment_count' of non-object in wp-content/plugins/article-displayer-for-the-daily-wtf/views/plugin.php on line 7
    • > PHP Notice
      Undefined variable: article in wp-content/plugins/article-displayer-for-the-daily-wtf/views/plugin.php on line 24
    • > PHP Notice
      Trying to get property 'name' of non-object in wp-content/plugins/article-displayer-for-the-daily-wtf/views/plugin.php on line 38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/article-displayer-for-the-daily-wtf/tdwtf-plugin.php:14
    • > PHP Notice
      Undefined variable: article in wp-content/plugins/article-displayer-for-the-daily-wtf/views/plugin.php on line 16
    • > PHP Notice
      Undefined variable: article in wp-content/plugins/article-displayer-for-the-daily-wtf/views/plugin.php on line 38

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

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: wtf, humor, daily, thedailywtf, technology

article-displayer-for-the-daily-wtf/tdwtf-plugin.php 92% from 13 tests

The entry point to "Article Displayer for The Daily WTF" version 1.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("article-displayer-for-the-daily-wtf.php" instead of "tdwtf-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected338 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP54418171
JavaScript110066
Sass114058
CSS11143

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity2.67
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.62
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods9
▷ Static methods333.33%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected