72% select-estados-e-cidades-brasil

Code Review | Select Estados e Cidades Brasil

WordPress plugin Select Estados e Cidades Brasil scored72%from 54 tests.

About plugin

  • Plugin page: select-estados-e-...
  • Plugin version: 1.6
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0
  • WordPress version: 6.3.1
  • First release: Oct 18, 2021
  • Latest release: May 30, 2022
  • Number of updates: 12
  • Update frequency: every 18.6 days
  • Top authors: mestresdowp (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /1,735 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by Select Estados e Cidades Brasil
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.52 ▼14.46
Dashboard /wp-admin3.32 ▲0.0147.89 ▲2.15
Posts /wp-admin/edit.php3.37 ▲0.0146.50 ▼4.29
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.94 ▼14.02
Media Library /wp-admin/upload.php3.24 ▲0.0136.91 ▲3.24
Estados e Cidades /wp-admin/admin.php?page=secbr_wp3.2134.05

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Select Estados e Cidades Brasil
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲7813.31 ▼1.075.00 ▲2.9840.67 ▲4.23
Dashboard /wp-admin2,230 ▲456.02 ▲0.20101.00 ▼0.1581.49 ▲42.58
Posts /wp-admin/edit.php2,113 ▲242.06 ▲0.0934.91 ▼6.8732.63 ▼3.54
Add New Post /wp-admin/post-new.php1,541 ▲1923.09 ▼0.08718.60 ▲103.7463.22 ▲15.14
Media Library /wp-admin/upload.php1,403 ▲154.26 ▲0.0898.93 ▼6.4070.91 ▲26.76
Estados e Cidades /wp-admin/admin.php?page=secbr_wp9792.2229.8541.74

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 25% 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)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=secbr_wp
    • > Warning in wp-content/plugins/select-estados-e-cidades-brasil/admin/includes/mwp-secbr-html-form.php+35
    include(html/documentacao.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/admin.php?page=secbr_wp
    • > Warning in wp-content/plugins/select-estados-e-cidades-brasil/admin/includes/mwp-secbr-html-form.php+35
    include(): Failed opening 'html/documentacao.php' for inclusion (include_path='.:/usr/share/php')
    • > GET request to /wp-admin/admin.php?page=secbr_wp
    • > Warning in wp-content/plugins/select-estados-e-cidades-brasil/admin/includes/mwp-secbr-html-form.php+35
    include(html/plugins.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/admin.php?page=secbr_wp
    • > Warning in wp-content/plugins/select-estados-e-cidades-brasil/admin/includes/mwp-secbr-html-form.php+35
    include(): Failed opening 'html/plugins.php' for inclusion (include_path='.:/usr/share/php')
    • > GET request to /wp-admin/admin.php?page=secbr_wp
    • > Warning in wp-content/plugins/select-estados-e-cidades-brasil/admin/includes/html/mestres-wp-sidebar.php+6
    simplexml_load_file(): https://www.mestresdowp.com.br/checkout/artigos.php:1: parser error : Start tag expected, '<' not found
    • > GET request to /wp-admin/admin.php?page=secbr_wp
    • > Warning in wp-content/plugins/select-estados-e-cidades-brasil/admin/includes/html/mestres-wp-sidebar.php+6
    simplexml_load_file(): [{"ID":306678,"post_author":"2","post_date":"2023-09-30 10:00:00","post_date_gmt
    • > GET request to /wp-admin/admin.php?page=secbr_wp
    • > Warning in wp-content/plugins/select-estados-e-cidades-brasil/admin/includes/html/mestres-wp-sidebar.php+6
    simplexml_load_file(): ^
    • > GET request to /wp-admin/admin.php?page=secbr_wp
    • > Notice in wp-content/plugins/select-estados-e-cidades-brasil/admin/includes/html/mestres-wp-sidebar.php+8
    Trying to get property 'artigo' of non-object
    • > GET request to /wp-admin/admin.php?page=secbr_wp
    • > Warning in wp-content/plugins/select-estados-e-cidades-brasil/admin/includes/html/mestres-wp-sidebar.php+8
    Invalid argument supplied for foreach()

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
The following issues need your attention
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/select-estados-e-cidades-brasil/admin/includes/html/mestres-wp-copyright.php
    • > /wp-content/plugins/select-estados-e-cidades-brasil/admin/includes/html/mestres-wp-sidebar.php
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      simplexml_load_file(): [{"ID":306678,"post_author":"2","post_date":"2023-09-30 10:00:00","post_date_gmt in wp-content/plugins/select-estados-e-cidades-brasil/admin/includes/html/mestres-wp-sidebar.php on line 6
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/select-estados-e-cidades-brasil/admin/includes/html/mestres-wp-sidebar.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/select-estados-e-cidades-brasil/admin/mwp-secbr-admin.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/select-estados-e-cidades-brasil/admin/mwp-secbr-admin.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/select-estados-e-cidades-brasil/admin/includes/html/config.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/select-estados-e-cidades-brasil/includes/mwp-secbr-scripts.php:2
    • > PHP Warning
      simplexml_load_file(): https://www.mestresdowp.com.br/checkout/artigos.php:1: parser error : Start tag expected, '<' not found in wp-content/plugins/select-estados-e-cidades-brasil/admin/includes/html/mestres-wp-sidebar.php on line 6
    • > PHP Notice
      Undefined variable: mwp_url_icons in wp-content/plugins/select-estados-e-cidades-brasil/admin/includes/html/config.php on line 3
    • > PHP Notice
      Trying to get property 'artigo' of non-object in wp-content/plugins/select-estados-e-cidades-brasil/admin/includes/html/mestres-wp-sidebar.php on line 8
    • > PHP Warning
      simplexml_load_file(): ^ in wp-content/plugins/select-estados-e-cidades-brasil/admin/includes/html/mestres-wp-sidebar.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% 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
Attributes that require attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === select-estados-e-cidades-brasil === )
You can take inspiration from this readme.txt

select-estados-e-cidades-brasil/select-estados-cidades-brasil.php 92% from 13 tests

The primary PHP file in "Select Estados e Cidades Brasil" version 1.6 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("select-estados-e-cidades-brasil.php" instead of "select-estados-cidades-brasil.php")

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
No dangerous file extensions were detected281 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP7214172
CSS1110109

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
5 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/mwp-ico-off.png1.33KB0.73KB▼ 45.19%
admin/assets/images/mwp-logotipo.png4.97KB2.46KB▼ 50.49%
admin/assets/images/bytesize_settings.png1.23KB0.70KB▼ 43.11%
admin/assets/images/mwp-ico-on.png1.34KB0.69KB▼ 48.18%
admin/assets/images/faviconmwp.png0.58KB0.62KB0.00%