77% oc2wp-bookmarks

Code Review | NC2WP Bookmarks

WordPress plugin NC2WP Bookmarks scored77%from 54 tests.

About plugin

  • Plugin page: oc2wp-bookmarks
  • Plugin version: 1.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.2-5.2.3
  • WordPress version: 6.3.1
  • First release: Dec 27, 2014
  • Latest release: Nov 1, 2019
  • Number of updates: 14
  • Update frequency: every 126.5 days
  • Top authors: hikingnerd (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /8,538 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼1.57ms] Passed 4 tests

A check of server-side resources used by NC2WP Bookmarks
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1546.43 ▲1.13
Dashboard /wp-admin3.45 ▲0.1553.97 ▲0.43
Posts /wp-admin/edit.php3.57 ▲0.2150.30 ▼4.62
Add New Post /wp-admin/post-new.php6.03 ▲0.1490.24 ▼3.20
Media Library /wp-admin/upload.php3.38 ▲0.1442.99 ▲5.58
NC2WP Bookmarks /wp-admin/options-general.php?page=oc2wp-bookmarks/nc2wp-bookmarks.php3.3235.10

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, 25 new options
New WordPress options
nc2wpbm_table_description_label
nc2wpbm_dbversion
nc2wpbm_sql_database
db_upgraded
can_compress_scripts
nc2wpbm_op_type
widget_recent-comments
nc2wpbm_table_description_display
widget_recent-posts
nc2wpbm_table_title_label
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for NC2WP Bookmarks
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.35 ▼0.242.03 ▼0.0244.52 ▼1.60
Dashboard /wp-admin2,196 ▲195.55 ▼0.03101.78 ▼5.0544.92 ▲0.57
Posts /wp-admin/edit.php2,104 ▲42.02 ▲0.0441.39 ▲2.9340.02 ▲1.73
Add New Post /wp-admin/post-new.php1,529 ▲323.29 ▼0.13688.53 ▼4.0857.17 ▲9.27
Media Library /wp-admin/upload.php1,407 ▲74.22 ▲0.05101.82 ▼37.7844.50 ▼8.53
NC2WP Bookmarks /wp-admin/options-general.php?page=oc2wp-bookmarks/nc2wp-bookmarks.php1,1852.1624.7628.67

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
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_nc2wpbm_list_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=oc2wp-bookmarks/nc2wp-bookmarks.php
    • > Notice in wp-content/plugins/oc2wp-bookmarks/nc2wp-bookmarks.php+351
    Undefined offset: 1

SRP 50% 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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/oc2wp-bookmarks/nc2wp-bookmarks.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/oc2wp-bookmarks/widget.inc.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === oc2wp-bookmarks === )
  • Screenshots: These screenshots require images: #1 (nc2wp Settings), #2 (Nextcloud Plugin), #3 (Resulting Table enhanded by TablePress), #4 (Widget configuration), #5 (Widget with description of the Bookmarks as mouseover text)
Please take inspiration from this readme.txt

oc2wp-bookmarks/nc2wp-bookmarks.php 92% from 13 tests

The main file in "NC2WP Bookmarks" v. 1.3.2 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: It is recommended to name the main PHP file as the plugin slug ("oc2wp-bookmarks.php" instead of "nc2wp-bookmarks.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin653 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP413075653

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity10.50
▷ Minimum class complexity2.00
▷ Maximum class complexity19.00
Average method complexity4.17
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 1.38MB with 0.84MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png13.83KB5.67KB▼ 59.02%
assets/banner-1544x500.png190.26KB78.27KB▼ 58.86%
assets/banner-772x250.png56.76KB24.66KB▼ 56.56%
assets/5_oc2wp-widget-example.png485.93KB140.13KB▼ 71.16%
assets/2_oc2wp_OCapp.png117.22KB48.81KB▼ 58.36%