78% zotpress

Code Review | Zotpress

WordPress plugin Zotpress scored78%from 54 tests.

About plugin

  • Plugin page: zotpress
  • Plugin version: 7.3.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.3.2
  • WordPress version: 6.3.1
  • First release: Feb 5, 2011
  • Latest release: Nov 1, 2023
  • Number of updates: 150
  • Update frequency: every 31.0 days
  • Top authors: kseaborn (100%)

Code review

54 tests

User reviews

64 reviews

Install metrics

2,000+ active /97,217 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.65MB] [CPU: ▲2.58ms] 75% from 4 tests

Analyzing server-side resources used by Zotpress
It is recommended to improve the following
  • CPU: Total CPU usage should be kept under 500.00ms (currently 682.32ms on /wp-admin/admin.php?page=Zotpress)
PageMemory (MB)CPU Time (ms)
Home /4.12 ▲0.6649.05 ▲9.53
Dashboard /wp-admin3.96 ▲0.6153.81 ▼10.29
Posts /wp-admin/edit.php4.07 ▲0.7155.77 ▲12.44
Add New Post /wp-admin/post-new.php6.56 ▲0.6792.12 ▲6.74
Media Library /wp-admin/upload.php3.89 ▲0.6541.18 ▲4.35
Browse /wp-admin/admin.php?page=Zotpress4.43682.32
Help /wp-admin/admin.php?page=Zotpress&help=true3.9843.86
Options /wp-admin/admin.php?page=Zotpress&options=true3.9142.37
Accounts /wp-admin/admin.php?page=Zotpress&accounts=true3.9240.68

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 100 new files
Database: 4 new tables, 12 new options
New tables
wp_zotpress_zoteroItemImages
wp_zotpress
wp_zotpress_oauth
wp_zotpress_cache
New WordPress options
Zotpress_StyleList
widget_recent-posts
db_upgraded
Zotpress_main_db_version
widget_recent-comments
Zotpress_cache_version
widget_zotpresssidebarwidget
Zotpress_oauth_db_version
widget_theysaidso_widget
Zotpress_zoteroItemImages_db_version
...

Browser metrics Passed 4 tests

Zotpress: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲9414.72 ▲0.141.84 ▲0.1344.69 ▲2.79
Dashboard /wp-admin2,229 ▲515.54 ▼0.1196.93 ▼27.8176.60 ▲35.39
Posts /wp-admin/edit.php2,146 ▲432.01 ▲0.0134.16 ▼1.6934.76 ▲5.73
Add New Post /wp-admin/post-new.php7,128 ▲5,60026.23 ▲3.15934.15 ▲230.5446.71 ▼16.50
Media Library /wp-admin/upload.php1,452 ▲524.21 ▼0.02105.25 ▼7.8444.23 ▼4.93
Browse /wp-admin/admin.php?page=Zotpress1,0713.2550.6661.92
Help /wp-admin/admin.php?page=Zotpress&help=true2,4683.6363.95124.31
Options /wp-admin/admin.php?page=Zotpress&options=true1,3573.2744.0159.87
Accounts /wp-admin/admin.php?page=Zotpress&accounts=true1,0813.2040.0362.50

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_zotpresssidebarwidget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • 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
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 take a closer look at the following
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/zotpress/lib/request/request.cite.php
    • > /wp-content/plugins/zotpress/lib/admin/admin.accounts.oauth.php
    • > /wp-content/plugins/zotpress/lib/request/request.dl.php
  • 19× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ZOTPRESS_PLUGIN_URL - assumed 'ZOTPRESS_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/zotpress/lib/admin/admin.setup.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/zotpress/lib/admin/admin.setup.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/zotpress/lib/admin/admin.install.php:179
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/zotpress/lib/admin/admin.menu.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/zotpress/lib/admin/admin.options.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/zotpress/lib/shortcode/shortcode.request.php:1056
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/zotpress/lib/admin/admin.options.form.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/zotpress/lib/admin/admin.menu.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/zotpress/lib/widget/widget.sidebar.php:6
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_var() on null in wp-content/plugins/zotpress/lib/widget/widget.metabox.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 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
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (Display items from individual or group Zotero libraries on your WordPress website. Special characters are supported.), #2 (Search for items and generate shortcodes for bibliographies and in-text citations using the "Zotpress Reference" meta box on edit screens.), #3 (Find the shortcode builder in the Gutenberg toolbar. Search for items and create bibliographies and in-text citations.), #4 (Give your citation an image using WordPress's Media Library or Open Library.), #5 (Share your library through your website. Allow visitors to browse by collection or tag.), #6 (Allow visitors to search your library by item metadata or tag, or both.)
  • Tags: There are too many tags (26 tag instead of maximum 10)
The official readme.txt might help

zotpress/zotpress.php Passed 13 tests

"Zotpress" version 7.3.7's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
65 characters long description:
Bringing Zotero and scholarly blogging to your WordPress website.

Code Analysis Passed 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
Success! There were no dangerous files found in this plugin12,323 lines of code in 65 files:
LanguageFilesBlank linesComment linesLines of code
PHP271,5471,0655,603
JavaScript269598893,620
CSS103522082,530
PO File1203271566
SVG1004

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity76.33
▷ Minimum class complexity69.00
▷ Maximum class complexity80.00
Average method complexity6.51
▷ Minimum method complexity1.00
▷ Maximum method complexity66.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods41
▷ Static methods00.00%
▷ Public methods41100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions57
▷ Named functions57100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
20 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/checkmark-green.png0.35KB0.20KB▼ 41.13%
css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
css/smoothness/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
images/icon.png0.66KB0.50KB▼ 23.85%