77% nic-app-stock

Code Review | Nic-app stock

WordPress plugin Nic-app stock scored 77% from 54 tests.

About plugin

  • Plugin page: nic-app-stock
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.5.1
  • WordPress version: 6.3.1
  • First release: Oct 16, 2020
  • Latest release: Oct 16, 2020
  • Number of updates: 29
  • Update frequency: N/A
  • Top authors: efraimbayarri (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 320 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼1.87ms] Passed 4 tests

A check of server-side resources used by Nic-app stock
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0744.80 ▲0.01
Dashboard /wp-admin3.37 ▲0.0750.94 ▼8.72
Posts /wp-admin/edit.php3.42 ▲0.0756.62 ▲4.30
Add New Post /wp-admin/post-new.php5.97 ▲0.09102.14 ▲7.78
Media Library /wp-admin/upload.php3.29 ▲0.0736.85 ▼3.06
Scheduling /wp-admin/admin.php?page=nicappstock-scheduling3.2935.81
Providers /wp-admin/edit.php?post_type=nicappstockproviders3.3438.84
Import /wp-admin/admin.php?page=nicappstock-import3.3135.44
Products /wp-admin/edit.php?post_type=nicappstockproducts3.3439.37
Nic-app Stock /wp-admin/admin.php?page=nicappstock3.3034.72

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 62 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Nic-app stock
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,933 ▲14413.55 ▲0.294.80 ▲2.8841.18 ▼6.98
Dashboard /wp-admin2,253 ▲474.96 ▲0.10104.12 ▼10.1879.39 ▲34.78
Posts /wp-admin/edit.php2,139 ▲502.00 ▲0.0041.05 ▲3.7533.24 ▼0.97
Add New Post /wp-admin/post-new.php1,557 ▲4323.17 ▲5.54697.46 ▲47.9555.96 ▲6.98
Media Library /wp-admin/upload.php1,432 ▲474.21 ▲0.0295.38 ▼4.7965.00 ▲21.74
Scheduling /wp-admin/admin.php?page=nicappstock-scheduling8552.0326.9825.39
Providers /wp-admin/edit.php?post_type=nicappstockproviders1,0691.9432.7934.06
Import /wp-admin/admin.php?page=nicappstock-import9132.0225.1629.69
Products /wp-admin/edit.php?post_type=nicappstockproducts1,1071.9331.6728.36
Nic-app Stock /wp-admin/admin.php?page=nicappstock8612.0224.5327.74

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
The following issues need your attention
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/nic-app-stock/public/partials/nicappstock-public-display.php
    • > /wp-content/plugins/nic-app-stock/vendor/automattic/woocommerce/tests/bootstrap.php
  • 10× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/nic-app-stock/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/OAuthTest.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/nic-app-stock/admin/partials/nicappstock-admin-display.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/nic-app-stock/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/RequestTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/nic-app-stock/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/ResponseTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/nic-app-stock/vendor/automattic/woocommerce/tests/WooCommerce/Tests/ClientTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/nic-app-stock/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/BasicAuthTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/nic-app-stock/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/HttpClientExceptionTest.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/nic-app-stock/admin/partials/nicappstock-admin-import-display.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/nic-app-stock/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/OptionsTest.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/nic-app-stock/admin/partials/nicappstock-admin-scheduling-display.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === nic-app-stock === )
The official readme.txt might help

nic-app-stock/nicappstock.php 77% from 13 tests

The main file in "Nic-app stock" v. 1.0.0 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: The principal plugin file should be the same as the plugin slug ("nic-app-stock.php" instead of "nicappstock.php")
  • Description: The description should be shorter than 140 characters (currently 203 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected2,401 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
PHP374851,7412,140
Markdown1400118
JSON30090
XML21026
YAML26021
JavaScript24546
CSS2080

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity8.48
▷ Minimum class complexity1.00
▷ Maximum class complexity90.00
Average method complexity2.06
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes25
▷ Abstract classes00.00%
▷ Concrete classes25100.00%
▷ Final classes00.00%
Methods178
▷ Static methods52.81%
▷ Public methods13978.09%
▷ Protected methods2111.80%
▷ Private methods1810.11%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants7
▷ Global constants114.29%
▷ Class constants685.71%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.05MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/NIC-APP-03-350x233.png42.81KB16.49KB▼ 61.48%
admin/img/nic-app-logo.png7.16KB0.88KB▼ 87.78%