10% wp-stock-sync

Code Review | Wp Stock Sync

WordPress plugin Wp Stock Sync scored 10% from 54 tests.

About plugin

  • Plugin page: wp-stock-sync
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.1
  • WordPress version: 5.8.1
  • First release: May 24, 2017
  • Latest release: Dec 12, 2017
  • Number of updates: 15
  • Update frequency: every 13.4 days
  • Top authors: rob9095 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 607 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/wp-stock-sync/wp-stock-sync.php+74
    Trying to access array offset on value of type bool

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

A check of server-side resources used by Wp Stock Sync
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /1.82 ▼0.905.22 ▼15.67
Dashboard /wp-admin1.83 ▼1.226.03 ▼50.91
Posts /wp-admin/edit.php1.84 ▼1.275.94 ▼30.69
Add New Post /wp-admin/post-new.php1.84 ▼3.606.59 ▼659.60
Media Library /wp-admin/upload.php1.84 ▼1.176.64 ▼31.18
WP Stock Sync /wp-admin/options-general.php?page=wp-stock-sync1.846.62

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 22 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Wp Stock Sync: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,821 ▲22516.25 ▲0.6412.39 ▲0.9545.73 ▼1.61
Dashboard /wp-admin2,982 ▲485.85 ▼0.16142.27 ▼13.64107.25 ▲0.00
Posts /wp-admin/edit.php2,748 ▲92.70 ▼0.0269.81 ▼8.2386.21 ▲0.38
Add New Post /wp-admin/post-new.php1,690 ▲718.80 ▲0.42388.31 ▲14.31108.49 ▲1.76
Media Library /wp-admin/upload.php1,816 ▲685.05 ▲0.06162.70 ▲17.48115.08 ▼2.02
WP Stock Sync /wp-admin/options-general.php?page=wp-stock-sync1,0402.3660.4174.37

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
These items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/wp-stock-sync/wp-stock-sync.php+74
    Trying to access array offset on value of type bool

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
Please fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-stock-sync
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/wp-stock-sync/wp-stock-sync.php+74
    Trying to access array offset on value of type bool

SRP 0% from 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
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-stock-sync/public/partials/wp-stock-sync-public-display.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-stock-sync/admin/partials/wp-stock-sync-admin-display.php:25

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

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: stock, out of stock, inventory, woocommerce, in stock...

wp-stock-sync/wp-stock-sync.php Passed 13 tests

The principal PHP file in "Wp Stock Sync" v. 1.0.0 is loaded by WordPress automatically on each request
97 characters long description:
A plugin for woocommerce that sums the variation stock and stores that value as the parent stock.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin292 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12175565286
JavaScript24546
CSS2080

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity1.57
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.14
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods28
▷ Static methods27.14%
▷ Public methods2382.14%
▷ Protected methods00.00%
▷ Private methods517.86%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin