74% abrestan

Code Review | abrestan Accounting

WordPress plugin abrestan Accounting scored 74% from 54 tests.

About plugin

  • Plugin page: abrestan
  • Plugin version: 2.2.3
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1.0-5.8
  • WordPress version: 5.9.2
  • First release: Sep 12, 2021
  • Latest release: Dec 14, 2021
  • Number of updates: 9
  • Update frequency: every 10.9 days
  • Top authors: abrestan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 269 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼291.85ms] Passed 4 tests

A check of server-side resources used by abrestan Accounting
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.1954.82 ▼0.39
Dashboard /wp-admin3.54 ▲0.1333.58 ▲0.45
Posts /wp-admin/edit.php3.76 ▲0.1241.11 ▲4.37
Add New Post /wp-admin/post-new.php7.00 ▲0.0391.83 ▼1,167.16
Media Library /wp-admin/upload.php3.42 ▲0.1324.80 ▼0.28

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 73 new files
Database: 2 new tables, 1 new option
New tables
wp_abrestan_event
wp_abrestan_order
New WordPress options
abrestan_db_option

Browser metrics Passed 4 tests

Checking browser requirements for abrestan Accounting
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲516.14 ▲0.516.37 ▲0.162.56 ▼1.53
Dashboard /wp-admin2,895 ▲416.19 ▲0.01118.63 ▼19.82156.24 ▼10.39
Posts /wp-admin/edit.php2,694 ▼03.24 ▼0.0069.76 ▲4.12147.69 ▲6.07
Add New Post /wp-admin/post-new.php1,773 ▲7521.40 ▼1.10443.50 ▲44.25160.53 ▲7.55
Media Library /wp-admin/upload.php1,698 ▲35.51 ▲0.00147.62 ▲10.02188.10 ▼4.80

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_abrestan_event
    • wp_abrestan_order
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • abrestan_db_option

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/abrestan/templates/admin/admin.php:2

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (login setting page), #2 (select company setting page), #3 (sync orders setting page)
You can take inspiration from this readme.txt

abrestan/abrestan.php 92% from 13 tests

"abrestan Accounting" version 2.2.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("5.2" instead of "4.1.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin29,543 lines of code in 51 files:
LanguageFilesBlank linesComment linesLines of code
CSS66026,06222,017
SVG2002,959
PHP355212982,779
JavaScript43541631,617
PO File24755144
JSON20027

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity11.43
▷ Minimum class complexity1.00
▷ Maximum class complexity99.00
Average method complexity3.95
▷ Minimum method complexity1.00
▷ Maximum method complexity83.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes28
▷ Abstract classes00.00%
▷ Concrete classes28100.00%
▷ Final classes13.57%
Methods101
▷ Static methods2120.79%
▷ Public methods9897.03%
▷ Protected methods00.00%
▷ Private methods32.97%
Functions24
▷ Named functions2395.83%
▷ Anonymous functions14.17%
Constants10
▷ Global constants10100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo-abrestan.png2.74KB1.43KB▼ 47.84%