90% ocean-product-sharing

Code Review | Ocean Product Sharing

WordPress plugin Ocean Product Sharing scored90%from 54 tests.

About plugin

  • Plugin page: ocean-product-sha...
  • Plugin version: 2.0.7
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3.1
  • WordPress version: 6.3.1
  • First release: Oct 19, 2016
  • Latest release: Sep 6, 2023
  • Number of updates: 43
  • Update frequency: every 58.4 days
  • Top authors: oceanwp (62.79%)apprimit (39.53%)

Code review

54 tests

User reviews

3 reviews

Install metrics

30,000+ active /836,899 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼11.81ms] Passed 4 tests

An overview of server-side resources used by Ocean Product Sharing
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0441.91 ▲3.33
Dashboard /wp-admin3.35 ▲0.0545.01 ▼7.26
Posts /wp-admin/edit.php3.47 ▲0.1150.54 ▲4.68
Add New Post /wp-admin/post-new.php5.93 ▲0.0491.65 ▼43.64
Media Library /wp-admin/upload.php3.27 ▲0.0435.10 ▲0.32

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts
ocean-product-sharing-version
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ocean Product Sharing
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.25 ▼1.121.68 ▼0.1844.11 ▲4.73
Dashboard /wp-admin2,206 ▲205.90 ▲0.94108.22 ▼4.0739.62 ▼7.36
Posts /wp-admin/edit.php2,086 ▼32.01 ▲0.0039.72 ▲3.3434.04 ▼0.89
Add New Post /wp-admin/post-new.php1,533 ▼022.99 ▼0.16647.32 ▲3.5950.96 ▼0.04
Media Library /wp-admin/upload.php1,391 ▼04.13 ▼0.0696.27 ▼4.1941.39 ▼0.50

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • ocean-product-sharing-version
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: oceanwp, social sharing, social, social share product, share product

ocean-product-sharing/ocean-product-sharing.php Passed 13 tests

This is the main PHP file of "Ocean Product Sharing" version 2.0.7, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
130 characters long description:
A simple plugin to add social sharing buttons to your single product page. Compatible with WooCommerce and Easy Digital Downloads.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected926 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP493220352
PO File46899214
CSS329162
Sass1336153
JavaScript42535
Markdown13010

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity2.14
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods14
▷ Static methods17.14%
▷ Public methods1392.86%
▷ Protected methods00.00%
▷ Private methods17.14%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
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 images were found in this plugin