10% paperlit

Code Review | Paperlit

WordPress plugin Paperlit scored10%from 54 tests.

About plugin

  • Plugin page: paperlit
  • Plugin version: 0.9.97
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Apr 24, 2017
  • Latest release: Nov 25, 2017
  • Number of updates: 63
  • Update frequency: every 4.6 days
  • Top authors: paperlit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,273 total downloads

Benchmarks

Plugin footprint 23% 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
    • > Warning in wp-content/plugins/paperlit/pages/themes.php+379
    mkdir(): File exists

Server metrics [RAM: ▼1.82MB] [CPU: ▼45.33ms] Passed 4 tests

Analyzing server-side resources used by Paperlit
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2448.76 ▲12.70
Dashboard /wp-admin2.12 ▼1.186.32 ▼37.52
Posts /wp-admin/edit.php2.12 ▼1.235.97 ▼37.23
Add New Post /wp-admin/post-new.php2.12 ▼3.765.75 ▼77.55
Media Library /wp-admin/upload.php2.12 ▼1.117.03 ▼29.02
Settings /wp-admin/admin.php?page=paperlit2.125.98
Add-ons /wp-admin/admin.php?page=paperlit-addons2.126.42
Exporter logs /wp-admin/admin.php?page=paperlit-logs2.126.03
All custom html /wp-admin/edit.php?post_type=paperlit_custom_html2.126.65
Add New /wp-admin/post-new.php?post_type=paperlit_custom_html2.125.98
Add New /wp-admin/post-new.php?post_type=paperlit_ad_bundle2.126.58
All issues /wp-admin/edit.php?post_type=paperlit_edition2.125.90
Connection Types /wp-admin/tools.php?page=connection-types2.126.48
Editorial project /wp-admin/edit-tags.php?taxonomy=paperlit_editorial_project&post_type=paperlit_edition2.135.91
All Ad Bundles /wp-admin/edit.php?post_type=paperlit_ad_bundle2.1211.44

Server storage [IO: ▲1.23MB] [DB: ▲0.02MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 231 new files
Database: 7 new tables, 13 new options
New tables
wp_p2pmeta
wp_paperlit_logs
wp_paperlit_purchased_issues
wp_paperlit_statistics
wp_paperlit_receipts
wp_p2p
wp_paperlit_auth_tokens
New WordPress options
paperlit_themes
widget_theysaidso_widget
widget_recent-comments
p2p_storage
db_upgraded
widget_recent-posts
widget_p2p
paperlit_settings
_paperlit_table_db_version
can_compress_scripts
...

Browser metrics Passed 4 tests

An overview of browser requirements for Paperlit
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,020 ▲27414.31 ▼0.114.95 ▲3.3642.91 ▼4.67
Dashboard /wp-admin2,439 ▲2516.42 ▲1.54137.65 ▲31.9374.37 ▲31.09
Posts /wp-admin/edit.php2,277 ▲1882.25 ▲0.2642.66 ▲7.1336.82 ▲0.35
Add New Post /wp-admin/post-new.php6,562 ▲5,03419.74 ▼3.37934.36 ▲258.7542.41 ▼14.34
Media Library /wp-admin/upload.php1,562 ▲1714.45 ▲0.28102.25 ▲2.6846.88 ▲1.49
Settings /wp-admin/admin.php?page=paperlit1,0371.9428.1826.62
Add-ons /wp-admin/admin.php?page=paperlit-addons9471.8029.3932.25
Exporter logs /wp-admin/admin.php?page=paperlit-logs1,8553.2255.4336.68
All custom html /wp-admin/edit.php?post_type=paperlit_custom_html1,2282.0735.4933.25
Add New /wp-admin/post-new.php?post_type=paperlit_custom_html1,8044.0369.0137.38
Add New /wp-admin/post-new.php?post_type=paperlit_ad_bundle1,8024.0663.7533.34
All issues /wp-admin/edit.php?post_type=paperlit_edition1,2632.0534.1431.37
Connection Types /wp-admin/tools.php?page=connection-types9621.9126.3530.40
Editorial project /wp-admin/edit-tags.php?taxonomy=paperlit_editorial_project&post_type=paperlit_edition1,3871.9532.4029.38
All Ad Bundles /wp-admin/edit.php?post_type=paperlit_ad_bundle1,2312.0735.2332.22

Uninstaller [IO: ▲0.51MB] [DB: ▲0.02MB] 25% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function convert_to_screen(), add_meta_box() was called incorrectly. Likely direct inclusion of wp-admin/includes/template.php in order to use add_meta_box(). This is very wrong. Hook the add_meta_box() call into the add_meta_boxes action instead. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie tables were found after uninstall: 7 tables
    • wp_paperlit_receipts
    • wp_p2pmeta
    • wp_p2p
    • wp_paperlit_auth_tokens
    • wp_paperlit_purchased_issues
    • wp_paperlit_statistics
    • wp_paperlit_logs
  • This plugin does not fully uninstall, leaving 13 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • paperlit_themes
    • widget_recent-comments
    • widget_p2p
    • _paperlit_table_db_version
    • p2p_storage
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 26 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=paperlit_ad_bundle
    • > POST request to /wp-admin/admin-ajax.php
    • > User notice in wp-includes/functions.php+5905
    Function convert_to_screen(), add_meta_box() was called incorrectly. Likely direct inclusion of wp-admin/includes/template.php in order to use add_meta_box(). This is very wrong. Hook the add_meta_box() call into the add_meta_boxes action instead. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=paperlit_ad_bundle
    • > User deprecated in wp-includes/functions.php+5828
    Hook contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.
    • > GET request to /wp-admin/tools.php?page=connection-types
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/tools.php?page=connection-types
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 73× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant PAPERLIT_PACKAGER_CONNECTORS_PATH - assumed 'PAPERLIT_PACKAGER_CONNECTORS_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/paperlit/packager/exporters/webcore/index.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/paperlit/pages/logs.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI' not found in wp-content/plugins/paperlit/libs/P2P/command.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'P2P_Item_Post' not found in wp-content/plugins/paperlit/libs/P2P/core/item-attachment.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'P2P_Indeterminate_Connection_Type' not found in wp-content/plugins/paperlit/libs/P2P/core/reciprocal-connection-type.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/paperlit/libs/PAPERLIT/logs.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'P2P_Column' not found in wp-content/plugins/paperlit/libs/P2P/admin/column-post.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function set_site_transient() in wp-content/plugins/paperlit/libs/EDD/EDD_SL_Plugin_Updater.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/paperlit/define.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'scbAdminPage' not found in wp-content/plugins/paperlit/libs/P2P/admin/tools-page.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=paperlit_ad_bundle
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/paperlit/assets//js/paperlit.metabox.js?ver=1.0:264:45)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=paperlit_ad_bundle
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === paperlit === )
  • Tags: You are using too many tags: 24 tag instead of maximum 10
  • Requires at least: Version format is invalid
You can take inspiration from this readme.txt

paperlit/paperlit.php Passed 13 tests

The main PHP file in "Paperlit" ver. 0.9.97 adds more information about the plugin and also serves as the entry point for this plugin
69 characters long description:
Paperlit turns Wordpress into a multi channel publishing environment.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin17,010 lines of code in 190 files:
LanguageFilesBlank linesComment linesLines of code
PHP1123,4714,00812,221
JavaScript313132721,974
CSS151971451,389
PO File165006311,195
HTML1170107
Markdown245090
JSON10022
SVG20012

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity17.08
▷ Minimum class complexity1.00
▷ Maximum class complexity129.00
Average method complexity3.02
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces3
Traits0
Classes109
▷ Abstract classes1311.93%
▷ Concrete classes9688.07%
▷ Final classes77.29%
Methods924
▷ Static methods18520.02%
▷ Public methods73779.76%
▷ Protected methods14115.26%
▷ Private methods464.98%
Functions66
▷ Named functions6496.97%
▷ Anonymous functions23.03%
Constants69
▷ Global constants5376.81%
▷ Class constants1623.19%
▷ Public constants16100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
15 PNG files occupy 0.18MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
logo-ppl.png20.94KB8.23KB▼ 60.69%
libs/P2P/admin/images/minus.png0.10KB0.11KB0.00%
PP-github.png23.82KB9.02KB▼ 62.15%
assets/img/send.png0.57KB0.78KB0.00%
logo.png21.66KB8.30KB▼ 61.68%