84% year-updater

Code Review | Year Updater

WordPress plugin Year Updater scored84%from 54 tests.

About plugin

  • Plugin page: year-updater
  • Plugin version: 1.3.0
  • PHP compatiblity: 8.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4.1
  • WordPress version: 6.3.1
  • First release: Jan 11, 2023
  • Latest release: Dec 1, 2023
  • Number of updates: 14
  • Update frequency: every 23.2 days
  • Top authors: smartkenyan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /390 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼6.65ms] Passed 4 tests

Server-side resources used by Year Updater
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0635.24 ▼8.78
Dashboard /wp-admin3.37 ▲0.0748.59 ▼6.37
Posts /wp-admin/edit.php3.49 ▲0.1349.42 ▼3.64
Add New Post /wp-admin/post-new.php5.97 ▲0.0989.92 ▼7.81
Media Library /wp-admin/upload.php3.30 ▲0.0734.39 ▲0.67

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Year Updater
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲2314.70 ▲0.431.58 ▼0.2636.16 ▼9.94
Dashboard /wp-admin2,215 ▲415.61 ▲0.0192.50 ▲0.7144.58 ▲2.08
Posts /wp-admin/edit.php2,120 ▲201.99 ▲0.0436.16 ▼5.3336.56 ▲4.01
Add New Post /wp-admin/post-new.php1,543 ▲1423.44 ▲0.38677.47 ▲84.2152.65 ▼1.24
Media Library /wp-admin/upload.php1,420 ▲294.18 ▼0.1095.78 ▼3.2343.01 ▲2.81

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      require_once(YU_PLUGIN_PATHincludes/yu-settings.php): failed to open stream: No such file or directory in wp-content/plugins/year-updater/yu-core.php on line 3
    • > PHP Notice
      Undefined index: post_type in wp-content/plugins/year-updater/includes/yu-preview.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'YU_PLUGIN_PATHincludes/yu-settings.php' (include_path='.:/usr/share/php') in wp-content/plugins/year-updater/yu-core.php on line 3
    • > PHP Warning
      Use of undefined constant YU_PLUGIN_PATH - assumed 'YU_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/year-updater/yu-core.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_posts() in wp-content/plugins/year-updater/includes/yu-preview.php:6

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 Passed 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: year, updater, title

year-updater/year-updater.php Passed 13 tests

Analyzing the main PHP file in "Year Updater" version 1.3.0
90 characters long description:
This plugin allows you to update the year in the titles of your posts to the current year.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected358 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP78734358
CSS1030
JavaScript1250

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity4.33
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity1.83
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods26
▷ Static methods00.00%
▷ Public methods2180.77%
▷ Protected methods00.00%
▷ Private methods519.23%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants3
▷ Global constants3100.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
PNG images were not found in this plugin