74% abrestan

Code Review | abrestan Accounting

WordPress plugin abrestan Accounting scored74%from 54 tests.

About plugin

  • Plugin page: abrestan
  • Plugin version: 2.2.6
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1.0-5.8
  • WordPress version: 6.3.1
  • First release: Sep 12, 2021
  • Latest release: Apr 25, 2023
  • Number of updates: 12
  • Update frequency: every 49.6 days
  • Top authors: abrestan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /612 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▲1.09ms] Passed 4 tests

Server-side resources used by abrestan Accounting
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0347.37 ▲4.03
Dashboard /wp-admin3.33 ▲0.0355.10 ▲4.67
Posts /wp-admin/edit.php3.38 ▲0.0251.47 ▼4.93
Add New Post /wp-admin/post-new.php5.91 ▲0.0299.24 ▲9.71
Media Library /wp-admin/upload.php3.25 ▲0.0237.46 ▲0.60

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 73 new files
Database: 2 new tables, 7 new options
New tables
wp_abrestan_order
wp_abrestan_event
New WordPress options
abrestan_db_option
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for abrestan Accounting
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.37 ▼0.191.80 ▲0.2043.44 ▼1.58
Dashboard /wp-admin2,198 ▲185.58 ▼0.0989.52 ▼2.2342.34 ▼0.37
Posts /wp-admin/edit.php2,100 ▼31.98 ▼0.0133.99 ▼3.0232.78 ▲0.37
Add New Post /wp-admin/post-new.php1,526 ▼023.27 ▼0.40699.58 ▼18.5463.23 ▼8.17
Media Library /wp-admin/upload.php1,400 ▼04.16 ▼0.0293.00 ▼13.2444.03 ▼0.87

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie tables detected upon uninstall: 2 tables
    • wp_abrestan_order
    • wp_abrestan_event
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • can_compress_scripts
    • abrestan_db_option
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/abrestan/templates/admin/admin.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
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 look at the official readme.txt

abrestan/abrestan.php 92% from 13 tests

"abrestan Accounting" version 2.2.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • 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 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected29,632 lines of code in 51 files:
LanguageFilesBlank linesComment linesLines of code
CSS66026,06222,017
SVG2002,959
PHP355562982,870
JavaScript43561631,615
PO File24755144
JSON20027

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity11.93
▷ Minimum class complexity1.00
▷ Maximum class complexity99.00
Average method complexity4.06
▷ Minimum method complexity1.00
▷ Maximum method complexity83.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes28
▷ Abstract classes00.00%
▷ Concrete classes28100.00%
▷ Final classes13.57%
Methods102
▷ Static methods2120.59%
▷ Public methods9997.06%
▷ Protected methods00.00%
▷ Private methods32.94%
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

It is recommended to compress PNG files in your plugin to 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%