10% dynamic-copyright-year

Code Review | Dynamic Copyright Year

WordPress plugin Dynamic Copyright Year scored10%from 54 tests.

About plugin

  • Plugin page: dynamic-copyright...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Dec 1, 2022
  • Latest release: Jul 6, 2023
  • Number of updates: 10
  • Update frequency: every 23.3 days
  • Top authors: 5starplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /953 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
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/dynamic-copyright-year/dynamic-copyright-year.php+38
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲5.33MB] [CPU: ▲30.20ms] 75% from 4 tests

Analyzing server-side resources used by Dynamic Copyright Year
Please have a look at the following items
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 5.33MB on /wp-admin/tools.php?page=csf-welcome)
PageMemory (MB)CPU Time (ms)
Home /8.94 ▲5.4885.48 ▲46.70
Dashboard /wp-admin8.96 ▲5.6693.78 ▲39.99
Posts /wp-admin/edit.php8.96 ▲5.6183.19 ▲11.71
Add New Post /wp-admin/post-new.php10.46 ▲4.58131.54 ▲32.33
Media Library /wp-admin/upload.php8.96 ▲5.7376.55 ▲36.75
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.9673.24
Codestar Framework /wp-admin/tools.php?page=csf-welcome8.9675.78

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Dynamic Copyright Year
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲6514.38 ▲0.041.73 ▼0.0732.32 ▼8.01
Dashboard /wp-admin2,235 ▲585.52 ▼0.1583.97 ▼7.0538.60 ▼7.58
Posts /wp-admin/edit.php2,141 ▲381.97 ▼0.0634.14 ▼6.6435.57 ▼0.83
Add New Post /wp-admin/post-new.php1,547 ▲1923.01 ▲1.82659.39 ▼24.8064.87 ▲1.83
Media Library /wp-admin/upload.php1,434 ▲314.30 ▲0.0797.11 ▼6.6144.16 ▼2.46
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1021.6927.5733.48
Codestar Framework /wp-admin/tools.php?page=csf-welcome1,4623.5451.6560.29

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/dynamic-copyright-year/inc/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • widget_recent-comments
    • fs_accounts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • fs_active_plugins
    • theysaidso_admin_options
    • db_upgraded
    • fs_debug_mode
    • fscymu_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
Please fix the following
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function fsdcy_fs() in wp-content/plugins/dynamic-copyright-year/csf-options.php:342
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/dynamic-copyright-year/plugin_footer.php:76
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/dynamic-copyright-year/whyupgrade.php:67
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_file_data() in wp-content/plugins/dynamic-copyright-year/dynamic-copyright-year.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: localization, footer links, copyright, privacy policy, dynamic

dynamic-copyright-year/dynamic-copyright-year.php Passed 13 tests

The primary PHP file in "Dynamic Copyright Year" version 1.0.3 is used by WordPress to initiate all plugin functionality
76 characters long description:
Updates the copyright year in the footer dynamically so it's always current.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected50,530 lines of code in 236 files:
LanguageFilesBlank linesComment linesLines of code
PHP19110,18718,24743,224
PO File203,1983,5916,500
Markdown31530593
JavaScript53661196
CSS150015
SVG2002

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
The following items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity54.66
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.87
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes102
▷ Abstract classes43.92%
▷ Concrete classes9896.08%
▷ Final classes00.00%
Methods1,442
▷ Static methods22815.81%
▷ Public methods1,05373.02%
▷ Protected methods171.18%
▷ Private methods37225.80%
Functions124
▷ Named functions12399.19%
▷ Anonymous functions10.81%
Constants145
▷ Global constants9867.59%
▷ Class constants4732.41%
▷ Public constants47100.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
5 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/images/5starplugins_logo_final_600pxwide.png9.06KB4.50KB▼ 50.30%
inc/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
inc/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
inc/images/dynamic_copyright_year_plugin_logo_horizontal_transparent_300x150.png29.38KB9.98KB▼ 66.02%
inc/codestar-framework/assets/images/checkerboard.png2.29KB2.54KB0.00%