78% post-bookmarks

Code Review | Post Bookmarks

WordPress plugin Post Bookmarks scored78%from 54 tests.

About plugin

  • Plugin page: post-bookmarks
  • Plugin version: 2.1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.1.1
  • WordPress version: 6.3.1
  • First release: Dec 6, 2016
  • Latest release: Apr 5, 2019
  • Number of updates: 23
  • Update frequency: every 36.7 days
  • Top authors: grosbouff (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,230 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.27MB] [CPU: ▼2.13ms] Passed 4 tests

A check of server-side resources used by Post Bookmarks
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2642.75 ▼2.09
Dashboard /wp-admin3.57 ▲0.2254.87 ▼10.77
Posts /wp-admin/edit.php3.68 ▲0.3258.95 ▲7.00
Add New Post /wp-admin/post-new.php6.20 ▲0.31104.05 ▼2.66
Media Library /wp-admin/upload.php3.49 ▲0.2649.38 ▲11.82
All Links /wp-admin/link-manager.php3.5141.41
Link Categories /wp-admin/edit-tags.php?taxonomy=link_category3.4939.40
Add New /wp-admin/link-add.php3.5040.93
Post Bookmarks /wp-admin/options-general.php?page=pbkm_settings3.4635.47

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 16 new files
Database: no new tables, 8 new options
New WordPress options
_post_bkmarks-db_version
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_links

Browser metrics Passed 4 tests

This is an overview of browser requirements for Post Bookmarks
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲6814.38 ▼0.051.67 ▼0.0338.77 ▼3.82
Dashboard /wp-admin2,233 ▲565.62 ▼0.0291.10 ▼2.0140.59 ▼1.91
Posts /wp-admin/edit.php2,138 ▲382.02 ▲0.0440.74 ▲1.7336.89 ▲0.12
Add New Post /wp-admin/post-new.php6,578 ▲5,05026.26 ▲3.18938.30 ▲267.1459.51 ▲6.22
Media Library /wp-admin/upload.php1,435 ▲324.15 ▼0.05110.86 ▲6.3347.75 ▲0.75
All Links /wp-admin/link-manager.php1,0722.0231.3633.97
Link Categories /wp-admin/edit-tags.php?taxonomy=link_category1,4122.1327.5532.65
Add New /wp-admin/link-add.php1,6662.5349.0534.49
Post Bookmarks /wp-admin/options-general.php?page=pbkm_settings9072.0038.7141.97

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_links
    • widget_recent-posts
    • db_upgraded
    • _post_bkmarks-db_version
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/post-bookmarks/post_bkmarks-admin-table.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/post-bookmarks/post_bookmarks.php:65
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/post-bookmarks/post_bkmarks-ajax.php:108
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/post-bookmarks/post_bkmarks-settings.php:6
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/post-bookmarks/post_bkmarks-admin-table.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/post-bookmarks/post_bkmarks-admin-table.php on line 4

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=pbkm_settings
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable&ver=6.3.1 1:28609 "jQuery.Deferred exception: metabox.find(...).live is not a function" "TypeError: metabox.find(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/post-bookmarks/_inc/js/post_bkmarks_admin.js?ver=2.1.7:8:48)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable&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,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=pbkm_settings
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-mouse,jquery-ui-sortable&ver=6.3.1 1:28721 Uncaught TypeError: metabox.find(...).live is not a function

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: links, custom links, related links, quick links, post links

post-bookmarks/post_bookmarks.php 92% from 13 tests

The main PHP file in "Post Bookmarks" ver. 2.1.7 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("post-bookmarks.php" instead of "post_bookmarks.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin1,809 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP64932701,226
JavaScript35925313
Sass2450148
CSS212114
Ruby1108

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity50.67
▷ Minimum class complexity10.00
▷ Maximum class complexity99.00
Average method complexity3.36
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods60
▷ Static methods711.67%
▷ Public methods5795.00%
▷ Protected methods23.33%
▷ Private methods11.67%
Functions17
▷ Named functions1694.12%
▷ Anonymous functions15.88%
Constants0
▷ Global constants00.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
No PNG files were detected