78% current-date-for-posts-pages-or-template

Code Review | Current Date for Posts, Pages, or Template

WordPress plugin Current Date for Posts, Pages, or Template scored78%from 54 tests.

About plugin

  • Plugin page: current-date-for-...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.2.4
  • WordPress version: 6.3.1
  • First release: Dec 12, 2019
  • Latest release: Dec 12, 2019
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: getseofix (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /563 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼6.34ms] Passed 4 tests

An overview of server-side resources used by Current Date for Posts, Pages, or Template
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0443.84 ▼0.75
Dashboard /wp-admin3.35 ▲0.0550.68 ▼4.47
Posts /wp-admin/edit.php3.40 ▲0.0547.52 ▼6.58
Add New Post /wp-admin/post-new.php5.93 ▲0.0484.63 ▼13.56
Media Library /wp-admin/upload.php3.27 ▲0.0538.42 ▼0.45

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 10 new options
New WordPress options
Current_DateInputField2
Current_DateInputField1
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
Current_DateInputField3
widget_current_date

Browser metrics Passed 4 tests

A check of browser resources used by Current Date for Posts, Pages, or Template
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲4414.38 ▼0.021.87 ▼0.4444.02 ▼0.36
Dashboard /wp-admin2,209 ▲215.83 ▲0.96115.29 ▲11.3478.19 ▲33.09
Posts /wp-admin/edit.php2,104 ▲152.01 ▼0.0333.86 ▼6.8832.71 ▼5.47
Add New Post /wp-admin/post-new.php1,527 ▲1323.28 ▲5.57775.51 ▲116.6353.85 ▼12.57
Media Library /wp-admin/upload.php1,400 ▲94.21 ▲0.03101.28 ▼1.8362.22 ▲17.96

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 10 options in the database
    • Current_DateInputField3
    • widget_recent-comments
    • widget_recent-posts
    • Current_DateInputField2
    • theysaidso_admin_options
    • Current_DateInputField1
    • widget_theysaidso_widget
    • widget_current_date
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/current-date-for-posts-pages-or-template/CustomCode.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_site_url() in wp-content/plugins/current-date-for-posts-pages-or-template/Settings.php:2

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 issues were found

Optimizations

Plugin configuration 96% 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
3 plugin tags: date shortcode, current time, current date

current-date-for-posts-pages-or-template/CurrentDate-GSF.php 92% from 13 tests

"Current Date for Posts, Pages, or Template" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("current-date-for-posts-pages-or-template.php" instead of "CurrentDate-GSF.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
Good job! No executable or dangerous file extensions detected349 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP35142349

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods216.67%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
7 PNG files occupy 0.72MB with 0.48MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png133.33KB41.64KB▼ 68.77%
screenicon.png10.21KB4.42KB▼ 56.75%
screenshot-1.png486.75KB151.56KB▼ 68.86%
promo.png32.45KB9.98KB▼ 69.24%
screenshot-2.png44.53KB14.66KB▼ 67.08%