10% zotero-notes

Code Review | Zotero Notes

WordPress plugin Zotero Notes scored 10% from 54 tests.

About plugin

  • Plugin page: zotero-notes
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.2.1
  • WordPress version: 6.3.1
  • First release: Jan 8, 2019
  • Latest release: Jun 7, 2019
  • Number of updates: 20
  • Update frequency: every 7.5 days
  • Top authors: janiko (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 840 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/zotero-notes/class.zotero-notes-referencesList.php+200
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.10MB] [CPU: ▼2.01ms] Passed 4 tests

This is a short check of server-side resources used by Zotero Notes
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0940.28 ▼1.73
Dashboard /wp-admin3.40 ▲0.1047.87 ▲0.47
Posts /wp-admin/edit.php3.52 ▲0.1652.57 ▲4.85
Add New Post /wp-admin/post-new.php5.98 ▲0.1084.70 ▼11.00
Media Library /wp-admin/upload.php3.33 ▲0.1037.53 ▲4.21
Zotero Notes /wp-admin/options-general.php?page=ZoteroNotes-setting-admin3.2929.39

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

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

Browser metrics Passed 4 tests

Zotero Notes: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲9613.29 ▼1.274.42 ▲2.7743.54 ▲0.57
Dashboard /wp-admin2,210 ▲255.90 ▲1.04108.64 ▲3.9242.18 ▲0.73
Posts /wp-admin/edit.php2,096 ▲71.99 ▼0.0238.68 ▼1.1834.82 ▼0.44
Add New Post /wp-admin/post-new.php1,536 ▲323.56 ▲0.18652.05 ▼5.1940.31 ▼17.64
Media Library /wp-admin/upload.php1,392 ▲44.17 ▼0.0298.23 ▼1.8940.93 ▼1.44
Zotero Notes /wp-admin/options-general.php?page=ZoteroNotes-setting-admin8232.0623.2626.64

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • zotero_notes_option_name
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/zotero-notes/class.zotero-notes-referencesList.php
    • > /wp-content/plugins/zotero-notes/class.zotero-notes-citation.php
    • > /wp-content/plugins/zotero-notes/zotero-notes.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/zotero-notes/class.zotero-notes-admin.php:200

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)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: reference, footnotes, citation, zotero, comments

zotero-notes/zotero-notes.php Passed 13 tests

This is the main PHP file of "Zotero Notes" version 1.1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
39 characters long description:
Simple footnote references using Zotero

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 detected559 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP5204294473
PO File1192354
CSS18032

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity10.60
▷ Minimum class complexity2.00
▷ Maximum class complexity22.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods37
▷ Static methods12.70%
▷ Public methods3491.89%
▷ Protected methods00.00%
▷ Private methods38.11%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.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
No PNG files were detected