10% widget-citation

Code Review | Widget Citation

WordPress plugin Widget Citation scored 10% from 54 tests.

About plugin

  • Plugin page: widget-citation
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6.1-5.6.2
  • WordPress version: 6.3.1
  • First release: Feb 26, 2021
  • Latest release: Feb 26, 2021
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: AndreVP2 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 354 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/widget-citation/widget_citation.php+19
    include(wp-content/plugins/widget-citation/\includes\functions.php): failed to open stream: No such file or directory

Server metrics [RAM: ▼1.94MB] [CPU: ▼50.64ms] Passed 4 tests

Analyzing server-side resources used by Widget Citation
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.05 ▼1.413.94 ▼33.58
Dashboard /wp-admin2.07 ▼1.245.79 ▼45.20
Posts /wp-admin/edit.php2.07 ▼1.296.30 ▼42.83
Add New Post /wp-admin/post-new.php2.07 ▼3.825.64 ▼80.96
Media Library /wp-admin/upload.php2.07 ▼1.164.88 ▼30.48

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Widget Citation
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.40 ▲0.021.56 ▼0.1841.92 ▼0.86
Dashboard /wp-admin2,203 ▲155.95 ▲0.9195.17 ▼11.4838.94 ▼5.21
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0639.52 ▲1.6534.52 ▼1.89
Add New Post /wp-admin/post-new.php1,538 ▼623.24 ▲5.01585.02 ▼51.0149.54 ▼3.37
Media Library /wp-admin/upload.php1,388 ▲34.27 ▲0.1094.34 ▼8.3941.88 ▼3.05

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
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/widget-citation/widget_citation.php+19
    include(wp-content/plugins/widget-citation/\includes\functions.php): failed to open stream: No such file or directory
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/widget-citation/includes/wdctt_adm_page.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/widget-citation/includes/widget_citation.class.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/widget-citation/includes/functions.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/widget-citation/widget_citation.php:14

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 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Contributors: Plugin contributors field is missing
You can take inspiration from this readme.txt

widget-citation/widget_citation.php 92% from 13 tests

The primary PHP file in "Widget Citation" version 1.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("widget-citation.php" instead of "widget_citation.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
Success! There were no dangerous files found in this plugin541 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP523489393
PO File1323879
CSS237169

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.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%
Functions13
▷ Named functions1184.62%
▷ Anonymous functions215.38%
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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/citation-logo.png24.91KB13.06KB▼ 47.58%