10% current-year-shortcode-for-post-titles

Code Review | Current Year Shortcode (for Post Titles)

WordPress plugin Current Year Shortcode (for Post Titles) scored10%from 54 tests.

About plugin

  • Plugin page: current-year-shor...
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.0
  • WordPress version: 6.3.1
  • First release: Jun 17, 2022
  • Latest release: Jun 17, 2022
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: wcdev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /236 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
You still need to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/current-year-shortcode-for-post-titles/wc-current-year-shortcode.php+127
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.93MB] [CPU: ▼52.55ms] Passed 4 tests

An overview of server-side resources used by Current Year Shortcode (for Post Titles)
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.405.34 ▼36.01
Dashboard /wp-admin2.08 ▼1.266.57 ▼53.13
Posts /wp-admin/edit.php2.08 ▼1.275.86 ▼36.37
Add New Post /wp-admin/post-new.php2.08 ▼3.806.01 ▼84.68
Media Library /wp-admin/upload.php2.08 ▼1.146.24 ▼25.75
Current Year Shortcode (for Post Titles) /wp-admin/options-general.php?page=wc-current-year-shortcode2.085.93

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Current Year Shortcode (for Post Titles)
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.56 ▼0.861.84 ▼0.2239.76 ▼3.40
Dashboard /wp-admin2,210 ▲225.82 ▲0.9496.42 ▼6.6539.56 ▲1.17
Posts /wp-admin/edit.php2,093 ▲42.02 ▼0.0333.61 ▼7.8433.96 ▼2.51
Add New Post /wp-admin/post-new.php1,536 ▲823.30 ▲4.92683.49 ▲80.3056.12 ▲1.20
Media Library /wp-admin/upload.php1,392 ▲14.21 ▼0.0196.01 ▼3.6140.46 ▼4.65
Current Year Shortcode (for Post Titles) /wp-admin/options-general.php?page=wc-current-year-shortcode7852.0626.8525.53

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/current-year-shortcode-for-post-titles/wc-current-year-shortcode.php+127
    Trying to access array offset on value of type bool
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wc-current-year-shortcode
    • > Notice in wp-content/plugins/current-year-shortcode-for-post-titles/wc-current-year-shortcode.php+131
    Trying to access array offset on value of type bool

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 fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/current-year-shortcode-for-post-titles/wc-current-year-shortcode.php:122

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
2 plugin tags: show current year in post title, current year shortcode

current-year-shortcode-for-post-titles/wc-current-year-shortcode.php 92% from 13 tests

Analyzing the main PHP file in "Current Year Shortcode (for Post Titles)" version 1.0
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("current-year-shortcode-for-post-titles.php" instead of "wc-current-year-shortcode.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected96 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1341096

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.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

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin