57% megabits-control-gastos

Code Review | Megabits Control Gastos

WordPress plugin Megabits Control Gastos scored57%from 54 tests.

About plugin

  • Plugin page: megabits-control-...
  • Plugin version: 2.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Jan 14, 2023
  • Latest release: Feb 18, 2023
  • Number of updates: 11
  • Update frequency: every 3.2 days
  • Top authors: megabits (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /521 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
This plugin's installer ran successfully

Server metrics [RAM: ▲1.22MB] [CPU: ▼4.50ms] Passed 4 tests

An overview of server-side resources used by Megabits Control Gastos
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.58 ▲1.1239.51 ▼6.22
Dashboard /wp-admin4.53 ▲1.2248.53 ▲1.45
Posts /wp-admin/edit.php4.58 ▲1.2247.53 ▼5.29
Add New Post /wp-admin/post-new.php7.33 ▲1.4491.74 ▼7.95
Media Library /wp-admin/upload.php4.54 ▲1.3142.32 ▲5.74
Todos los Gastos /wp-admin/edit.php?post_type=gastos4.4942.30
Categorías /wp-admin/edit-tags.php?taxonomy=categoria_gasto&post_type=gastos4.5439.40
Calendario /wp-admin/edit.php?post_type=gastos&page=gastos-calendar4.3535.64
Info /wp-admin/edit.php?post_type=gastos&page=gastos-info4.3534.01
Proveedores /wp-admin/edit-tags.php?taxonomy=proveedor_gasto&post_type=gastos4.4938.39
Facturas /wp-admin/edit.php?post_type=gastos&page=gastos-facturas4.3435.51
Añadir Nuevo /wp-admin/post-new.php?post_type=gastos4.7060.27

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 376 new files
Database: 1 new table, 8 new options
New tables
wp_mgb_events
New WordPress options
acf_version
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
mcg_need_update_events

Browser metrics Passed 4 tests

Checking browser requirements for Megabits Control Gastos
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲14813.93 ▼0.381.60 ▼0.3538.36 ▼9.87
Dashboard /wp-admin2,267 ▲765.71 ▼0.18108.25 ▲2.2491.67 ▲48.03
Posts /wp-admin/edit.php2,176 ▲872.60 ▲0.5941.01 ▼0.0936.04 ▲0.31
Add New Post /wp-admin/post-new.php11,666 ▲10,13329.10 ▲5.931,257.31 ▲577.8741.99 ▼29.56
Media Library /wp-admin/upload.php2,016 ▲6259.00 ▲4.82236.14 ▲133.3054.16 ▲12.33
Todos los Gastos /wp-admin/edit.php?post_type=gastos1,1672.5946.5732.42
Categorías /wp-admin/edit-tags.php?taxonomy=categoria_gasto&post_type=gastos1,4083.5545.0945.11
Calendario /wp-admin/edit.php?post_type=gastos&page=gastos-calendar1,5314.24103.9346.19
Info /wp-admin/edit.php?post_type=gastos&page=gastos-info9842.3531.6526.85
Proveedores /wp-admin/edit-tags.php?taxonomy=proveedor_gasto&post_type=gastos1,4113.5649.7547.96
Facturas /wp-admin/edit.php?post_type=gastos&page=gastos-facturas1,0312.5430.8628.38
Añadir Nuevo /wp-admin/post-new.php?post_type=gastos2,9159.57185.5849.38

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie tables detected upon uninstall: 1 table
    • wp_mgb_events
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • acf_version
    • theysaidso_admin_options
    • mcg_need_update_events
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=gastos&page=gastos-facturas
    • > Notice in wp-content/plugins/megabits-control-gastos/includes/mcg-listing.php+214
    Undefined variable: select_mes
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=gastos&page=gastos-facturas
    • > Notice in wp-content/plugins/megabits-control-gastos/includes/mcg-listing.php+231
    Undefined variable: select_trim
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=gastos&page=gastos-facturas
    • > Notice in wp-content/plugins/megabits-control-gastos/includes/mcg-pagination.php+37
    Undefined variable: html

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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/megabits-control-gastos/includes/mgb_fecth_events.php
  • 85× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/megabits-control-gastos/includes/acf/includes/admin/views/field-group-pro-features.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function acf_register_store() in wp-content/plugins/megabits-control-gastos/includes/acf/includes/acf-field-functions.php:4
    • > PHP Notice
      Undefined variable: rule in wp-content/plugins/megabits-control-gastos/includes/acf/includes/admin/views/html-location-rule.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/megabits-control-gastos/includes/acf/includes/fields/class-acf-field-number.php:5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/megabits-control-gastos/includes/acf/includes/admin/views/html-location-rule.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/megabits-control-gastos/includes/acf/includes/fields/class-acf-field-email.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/megabits-control-gastos/includes/mcg-listing.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/megabits-control-gastos/includes/acf/includes/fields/class-acf-field-password.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/megabits-control-gastos/includes/acf/includes/forms/form-taxonomy.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/megabits-control-gastos/includes/acf/includes/api/api-helpers.php:93

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=gastos
    • > Javascript (severe) in unknown
    https://cdn.jsdelivr.net/npm/fullcalendar/index.global.min.js 5:278720 Uncaught TypeError: Cannot read properties of null (reading 'isConnected')
    • > GET request to /wp-admin/edit.php?post_type=gastos
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'." "TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'.\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/megabits-control-gastos/js/gastos_admin.js?ver=6.3.1:37:14)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/edit.php?post_type=gastos
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'.

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: gastos, facturas, costs control

megabits-control-gastos/megabits-control-gastos.php 92% from 13 tests

The primary PHP file in "Megabits Control Gastos" version 2.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected141,856 lines of code in 307 files:
LanguageFilesBlank linesComment linesLines of code
PO File4435,40860,49371,932
JavaScript195,2757,35938,878
PHP1488,40118,38620,236
CSS186851,46710,441
JSON100218
SVG7600137
Markdown111014

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity15.23
▷ Minimum class complexity1.00
▷ Maximum class complexity95.00
Average method complexity2.84
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes102
▷ Abstract classes21.96%
▷ Concrete classes10098.04%
▷ Final classes00.00%
Methods784
▷ Static methods10.13%
▷ Public methods76697.70%
▷ Protected methods00.00%
▷ Private methods182.30%
Functions467
▷ Named functions46499.36%
▷ Anonymous functions30.64%
Constants12
▷ Global constants12100.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
9 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png9.91KB2.79KB▼ 71.87%
includes/acf/assets/inc/datepicker/images/ui-icons_DDDDDD_256x240.png3.68KB4.17KB0.00%
includes/acf/assets/inc/select2/3/select2x2.png0.64KB0.77KB0.00%
includes/acf/assets/inc/datepicker/images/ui-bg_highlight-soft_0_ffffff_1x100.png0.08KB0.08KB0.00%
assets/banner-772x250.png27.67KB10.80KB▼ 60.98%