73% aj-stock

Code Review | AJ Stock

WordPress plugin AJ Stock scored 73% from 54 tests.

About plugin

  • Plugin page: aj-stock
  • Plugin version: 0.9.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.3
  • WordPress version: 5.9.2
  • First release: Dec 23, 2019
  • Latest release: Jan 2, 2020
  • Number of updates: 4
  • Update frequency: every 2.8 days
  • Top authors: 2p1d (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 419 total downloads

Benchmarks

Plugin footprint 65% 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 gracefully, with no errors

Server metrics [RAM: ▲0.28MB] [CPU: ▲875.79ms] 75% from 4 tests

Server-side resources used by AJ Stock
The following require your attention
  • Extra CPU: Try to keep extra CPU usage under 200.00ms (currently 875.79ms on /wp-admin/upload.php)
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲0.331,288.26 ▲1,224.99
Dashboard /wp-admin3.68 ▲0.271,232.48 ▲1,147.12
Posts /wp-admin/edit.php3.91 ▲0.271,222.14 ▲1,178.04
Add New Post /wp-admin/post-new.php7.21 ▲0.241,250.64 ▼5.61
Media Library /wp-admin/upload.php3.63 ▲0.341,213.69 ▲1,183.61

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 44 new files
Database: 4 new tables, 2 new options
New tables
wp_ajsi_stock_log
wp_ajsi_stock_1m
wp_ajsi_stock_1d
wp_ajsi_stock_data
New WordPress options
widget_aj_stock_price
ajsi_db_version

Browser metrics Passed 4 tests

Checking browser requirements for AJ Stock
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,936 ▲19316.39 ▲0.7210.16 ▲4.492.63 ▲0.58
Dashboard /wp-admin2,918 ▲576.19 ▲0.01133.25 ▼17.88252.38 ▲84.63
Posts /wp-admin/edit.php2,716 ▲223.24 ▼0.1166.10 ▲0.48149.45 ▲7.67
Add New Post /wp-admin/post-new.php1,738 ▲7719.98 ▲3.91343.78 ▼110.99183.78 ▼6.59
Media Library /wp-admin/upload.php1,723 ▲255.69 ▲0.22130.36 ▼15.31271.71 ▲39.54

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The plugin did not uninstall successfully, leaving 4 tables in the database
    • wp_ajsi_stock_1m
    • wp_ajsi_stock_log
    • wp_ajsi_stock_data
    • wp_ajsi_stock_1d
  • Zombie WordPress options were found after uninstall: 2 options
    • widget_aj_stock_price
    • ajsi_db_version

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/aj-stock/aj-stock.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/aj-stock/function.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 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
These attributes need your attention:
  • Screenshots: A description for screenshot #5 is required in aj-stock/assets to your readme.txt
  • Donate link: Invalid URI found ("")
The official readme.txt might help

aj-stock/aj-stock.php Passed 13 tests

The entry point to "AJ Stock" version 0.9.2 is a PHP file that has certain tags in its header comment area
47 characters long description:
주가 정보를 보여주는 Plugin 입니다.

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 plugin4,376 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP204354143,217
JavaScript68260688
CSS4389432
XML10037
Markdown1002

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity101.75
▷ Minimum class complexity10.00
▷ Maximum class complexity246.00
Average method complexity5.11
▷ Minimum method complexity1.00
▷ Maximum method complexity63.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods98
▷ Static methods11.02%
▷ Public methods8384.69%
▷ Protected methods1515.31%
▷ Private methods00.00%
Functions36
▷ Named functions3597.22%
▷ Anonymous functions12.78%
Constants41
▷ Global constants41100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 0.09MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/aj-stock-chart.png12.19KB5.03KB▼ 58.74%
aj-stock-48-48-Icon.png6.15KB1.94KB▼ 68.46%
aj-stock-18-18-Icon.png3.54KB0.92KB▼ 74.12%
views/skins/basic_1/images/bohap.png1.66KB0.13KB▼ 92.21%
views/skins/basic_1/images/down.png1.96KB0.41KB▼ 79.18%