10% discordian-date-function

Code Review | Discordian Date Function

WordPress plugin Discordian Date Function scored10%from 54 tests.

About plugin

  • Plugin page: discordian-date-f...
  • Plugin version: 2.555
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0-6.0
  • WordPress version: 6.3.1
  • First release: Mar 16, 2017
  • Latest release: Jul 17, 2022
  • Number of updates: 19
  • Update frequency: every 102.5 days
  • Top authors: zlaxyi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /4,607 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/discordian-date-function/ddatefunc.php+146
    Methods with the same name as their class will not be constructors in a future version of PHP; Discordian_Date_Widget has a deprecated constructor

Server metrics [RAM: ▼1.70MB] [CPU: ▼47.48ms] Passed 4 tests

Server-side resources used by Discordian Date Function
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.29 ▼1.179.81 ▼30.21
Dashboard /wp-admin2.30 ▼1.0012.42 ▼36.11
Posts /wp-admin/edit.php2.30 ▼1.0511.84 ▼39.48
Add New Post /wp-admin/post-new.php2.30 ▼3.5812.01 ▼84.13
Media Library /wp-admin/upload.php2.30 ▼0.9211.15 ▼26.45

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 12 new options
New WordPress options
dtime_convert
can_compress_scripts
dtime_widget
widget_theysaidso_widget
ddatefunc_change
dtimefunc_change
widget_recent-comments
widget_discordian_date_func
widget_recent-posts
db_upgraded
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Discordian Date Function
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.43 ▼0.002.93 ▲1.2445.54 ▲3.27
Dashboard /wp-admin2,196 ▲165.55 ▼0.0485.78 ▼12.7239.49 ▼2.28
Posts /wp-admin/edit.php2,101 ▲41.99 ▼0.0537.76 ▼1.3734.46 ▼6.47
Add New Post /wp-admin/post-new.php1,529 ▼317.81 ▼5.42685.23 ▼18.2061.13 ▼15.06
Media Library /wp-admin/upload.php1,404 ▲14.25 ▲0.13108.81 ▲3.6646.59 ▼1.61
Discordian Date Function Settings /wp-admin/ddatefunc.php260.440.0917.75

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in Discordian_Date_Widget is deprecated since version 4.3.0! Use __construct() instead.
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_discordian_date_func

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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 take a closer look at the following
  • 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/discordian-date-function/ddatefunc.php:146

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
    • > GET request to /wp-admin/ddatefunc.php
    • > Network (severe)
    wp-admin/ddatefunc.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
10 plugin tags: erisian, dtime, widget, eris, time...

discordian-date-function/ddatefunc.php 85% from 13 tests

The main file in "Discordian Date Function" v. 2.555 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("discordian-date-function.php" instead of "ddatefunc.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 254 characters long)

Code Analysis 97% from 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
Success! There were no dangerous files found in this plugin625 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP14113460
JavaScript1824165

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 114)
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity114.00
▷ Minimum class complexity114.00
▷ Maximum class complexity114.00
Average method complexity29.25
▷ Minimum method complexity1.00
▷ Maximum method complexity114.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%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png28.32KB12.35KB▼ 56.38%