10% papershare-paperclip

Code Review | PaperShare PaperClip WordPress Plugin

WordPress plugin PaperShare PaperClip WordPress Plugin scored10%from 54 tests.

About plugin

  • Plugin page: papershare-paperclip
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-3.7.1
  • WordPress version: 6.3.1
  • First release: Nov 13, 2013
  • Latest release: Dec 4, 2013
  • Number of updates: 5
  • Update frequency: every 4.6 days
  • Top authors: PaperShare (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /604 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • The plugin cannot be installed
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)

Server metrics [RAM: ▼1.86MB] [CPU: ▼50.48ms] Passed 4 tests

Analyzing server-side resources used by PaperShare PaperClip WordPress Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.394.74 ▼34.38
Dashboard /wp-admin2.17 ▼1.145.28 ▼44.78
Posts /wp-admin/edit.php2.17 ▼1.197.20 ▼36.93
Add New Post /wp-admin/post-new.php2.17 ▼3.726.03 ▼85.83
Media Library /wp-admin/upload.php2.17 ▼1.065.89 ▼29.88
Papershare /wp-admin/options-general.php?page=cpapershare12.176.06

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 3 new files
Database: 1 new table, 6 new options
New tables
wp_cpapershare1
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

PaperShare PaperClip WordPress Plugin: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.43 ▲0.131.74 ▲0.0237.23 ▼6.37
Dashboard /wp-admin2,207 ▲195.82 ▲0.9598.76 ▼20.4238.77 ▼5.89
Posts /wp-admin/edit.php2,090 ▲12.02 ▼0.0335.62 ▲0.0730.29 ▼4.28
Add New Post /wp-admin/post-new.php1,536 ▲323.38 ▲0.07676.22 ▼0.5353.95 ▼4.15
Media Library /wp-admin/upload.php1,392 ▲44.23 ▲0.01102.80 ▼12.3142.25 ▼4.54
Papershare /wp-admin/options-general.php?page=cpapershare16831.536.5715.44

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=cpapershare1
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
    • > GET request to /wp-admin/options-general.php?page=cpapershare1
    • > Error in wp-admin/includes/template.php+1801
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/papershare-paperclip/settings.php on line 1 and exactly 2 expected in wp-admin/includes/template.php:1801
    Stack trace:
    #0 wp-content/plugins/papershare-paperclip/settings.php(1): do_settings_fields()
    #1 wp-content/plugins/papershare-paperclip/papershare.php(104): include('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(310): CPaperShare1->plugin_settings_page()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #7 {main}
    thrown

SRP 50% 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
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/papershare-paperclip/settings.php:1

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)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: papershare paperclip, papershare

papershare-paperclip/papershare.php 92% from 13 tests

The main file in "PaperShare PaperClip WordPress Plugin" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("papershare-paperclip.php" instead of "papershare.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin116 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP24420116

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.11
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin