68% papercite

Code Review | PAPERCITE

WordPress plugin PAPERCITE scored68%from 54 tests.

About plugin

  • Plugin page: papercite
  • Plugin version: 0.5.18
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.4
  • WordPress version: 6.3.1
  • First release: Jul 5, 2010
  • Latest release: Mar 10, 2020
  • Number of updates: 281
  • Update frequency: every 12.6 days
  • Top authors: bpiwowar (97.86%)digitalfisherman (2.49%)

Code review

54 tests

User reviews

7 reviews

Install metrics

900+ active /19,978 total downloads

Benchmarks

Plugin footprint 65% 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.23MB] [CPU: ▼3.81ms] Passed 4 tests

A check of server-side resources used by PAPERCITE
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2241.93 ▲3.53
Dashboard /wp-admin3.53 ▲0.2346.34 ▼1.37
Posts /wp-admin/edit.php3.65 ▲0.2947.57 ▼2.28
Add New Post /wp-admin/post-new.php6.11 ▲0.2383.78 ▼15.12
Media Library /wp-admin/upload.php3.46 ▲0.2336.32 ▲4.50
Papercite plug-in /wp-admin/options-general.php?page=papercite3.4460.64

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 64 new files
Database: 2 new tables, 7 new options
New tables
wp_plugin_papercite_url
wp_plugin_papercite
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
papercite_db_version
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

PAPERCITE: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,895 ▲14914.01 ▼0.785.30 ▲3.6037.75 ▼5.92
Dashboard /wp-admin2,208 ▲175.84 ▲0.95101.78 ▼4.6337.23 ▼8.13
Posts /wp-admin/edit.php2,100 ▲112.02 ▲0.0140.34 ▲3.1335.05 ▲1.67
Add New Post /wp-admin/post-new.php1,521 ▲223.41 ▼0.12597.60 ▼69.4046.39 ▼6.82
Media Library /wp-admin/upload.php1,399 ▲114.13 ▼0.04100.88 ▲0.4946.70 ▲1.98
Papercite plug-in /wp-admin/options-general.php?page=papercite1,0822.1128.2539.35

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie tables detected upon uninstall: 2 tables
    • wp_plugin_papercite
    • wp_plugin_papercite_url
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • papercite_db_version
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/papercite/utils/osbib2tpl.php
  • 22× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/papercite/tests/common.inc.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/papercite/tests/common.inc.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/papercite/papercite_options.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/papercite/papercite_db.php:42
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/papercite/papercite_db.php on line 30
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/papercite/tests/common.inc.php:5
    • > PHP Fatal error
      Uncaught Exception: Could not find /tmp/wordpress-tests-lib/includes/functions.php, have you run bin/install-wp-tests.sh ? in wp-content/plugins/papercite/tests/bootstrap.php:15
    • > PHP Warning
      fputs() expects parameter 1 to be resource, string given in wp-content/plugins/papercite/utils/osbib2tpl.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/papercite/tests/common.inc.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/papercite/tests/common.inc.php:5

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: footnotes, bibliography, formatting, bibtex

papercite/papercite-wp-plugin.php 85% from 13 tests

Analyzing the main PHP file in "PAPERCITE" version 0.5.18
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 246 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("papercite.php" instead of "papercite-wp-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin5,760 lines of code in 46 files:
LanguageFilesBlank linesComment linesLines of code
PHP278221,8824,693
Markdown74210576
Bourne Shell26054289
CSS214070
YAML37062
XML34242
JavaScript241128

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity29.96
▷ Minimum class complexity1.00
▷ Maximum class complexity173.00
Average method complexity5.18
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes25
▷ Abstract classes14.00%
▷ Concrete classes2496.00%
▷ Final classes00.00%
Methods173
▷ Static methods1910.98%
▷ Public methods173100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions45
▷ Named functions4395.56%
▷ Anonymous functions24.44%
Constants14
▷ Global constants14100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
docs/bibfilter.png35.82KB12.22KB▼ 65.88%
docs/warning.png8.52KB2.58KB▼ 69.74%
img/external.png0.16KB0.16KB0.00%
img/pdf.png0.38KB0.32KB▼ 17.77%