84% moloni

Code Review | Moloni

WordPress plugin Moloniscored84%from 54 tests.

About plugin

  • Plugin page: moloni
  • Plugin version: 4.4.7
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Nov 4, 2019
  • Latest release: Nov 27, 2023
  • Number of updates: 138
  • Update frequency: every 10.8 days
  • Top authors: molonidevteam (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

2,000+ active /52,446 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼13.06ms] Passed 4 tests

This is a short check of server-side resources used by Moloni
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0033.79 ▼12.16
Dashboard /wp-admin3.31 ▼0.0446.75 ▼19.51
Posts /wp-admin/edit.php3.36 ▲0.0046.55 ▼4.24
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.01 ▼16.33
Media Library /wp-admin/upload.php3.23 ▲0.0032.14 ▲0.26

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 190 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Moloni
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.21 ▼0.121.57 ▼0.6237.03 ▼6.27
Dashboard /wp-admin2,195 ▲185.82 ▲0.1690.65 ▼8.4743.93 ▲0.81
Posts /wp-admin/edit.php2,100 ▼02.00 ▼0.0239.39 ▲0.4836.25 ▼0.59
Add New Post /wp-admin/post-new.php1,526 ▼023.67 ▲0.07584.01 ▼107.5945.21 ▼13.91
Media Library /wp-admin/upload.php1,400 ▲34.25 ▲0.0594.09 ▼22.8341.62 ▼8.92

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 20× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Moloni\\Exceptions\\Core\\MoloniException' not found in wp-content/plugins/moloni/src/Exceptions/HelperException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Moloni\\Exceptions\\Core\\MoloniException' not found in wp-content/plugins/moloni/src/Exceptions/ServiceException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Moloni\\Services\\Mails\\Abstracts\\MailAbstract' not found in wp-content/plugins/moloni/src/Services/Mails/DocumentWarning.php:7
    • > PHP Fatal error
      Trait 'Moloni\\Traits\\DocumentTypeTrait' not found in wp-content/plugins/moloni/src/Services/Documents/OpenDocument.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'Moloni\\Exceptions\\Core\\MoloniException' not found in wp-content/plugins/moloni/src/Exceptions/GenericException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/moloni/vendor/psr/log/Psr/Log/Test/TestLogger.php:57
    • > PHP Fatal error
      Trait 'Moloni\\Traits\\DocumentTypeTrait' not found in wp-content/plugins/moloni/src/Hooks/OrderDetails.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/moloni/src/Helpers/Logger.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/moloni/src/Templates/Modals/PendingOrders/BulkActionModal.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Moloni\\Exceptions\\Core\\MoloniException' not found in wp-content/plugins/moloni/src/Exceptions/DocumentWarning.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === Moloni=== )
You can take inspiration from this readme.txt

moloni/moloni.php Passed 13 tests

The main PHP file in "Moloni" ver. 4.4.7 adds more information about the plugin and also serves as the entry point for this plugin
69 characters long description:
A forma mais fácil de ligar a sua loja online com a sua faturação.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected21,617 lines of code in 127 files:
LanguageFilesBlank linesComment linesLines of code
PHP1051,9922,4728,288
CSS51,3605406,889
JavaScript71,3431,1024,879
SVG300771
Markdown31300393
HTML1433289
JSON300108

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity11.51
▷ Minimum class complexity1.00
▷ Maximum class complexity82.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces20
Interfaces2
Traits3
Classes76
▷ Abstract classes22.63%
▷ Concrete classes7497.37%
▷ Final classes00.00%
Methods423
▷ Static methods9722.93%
▷ Public methods29770.21%
▷ Protected methods112.60%
▷ Private methods11527.19%
Functions6
▷ Named functions233.33%
▷ Anonymous functions466.67%
Constants50
▷ Global constants714.00%
▷ Class constants4386.00%
▷ Public constants43100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
10 PNG files occupy 0.22MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
docs/web/images/tut/05.png31.77KB16.45KB▼ 48.22%
docs/web/images/tut/04.png20.79KB8.42KB▼ 59.47%
images/small_logo.png0.50KB0.37KB▼ 24.61%
docs/web/images/tut/01.png37.05KB14.10KB▼ 61.95%
docs/web/images/tut/03.png28.68KB18.69KB▼ 34.81%