10% demomentsomtres-address

Code Review | DeMomentSomTres Address

WordPress plugin DeMomentSomTres Address scored 10% from 54 tests.

About plugin

  • Plugin page: demomentsomtres-a...
  • Plugin version: 2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2.1-4.7.2
  • WordPress version: 5.9.2
  • First release: Aug 21, 2012
  • Latest release: Feb 8, 2017
  • Number of updates: 22
  • Update frequency: every 74.2 days
  • Top authors: marcqueralt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,603 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/demomentsomtres-address/freemius/includes/managers/class-fs-admin-menu-manager.php+123
    Undefined index: slug

Server metrics [RAM: ▲0.36MB] [CPU: ▼334.70ms] Passed 4 tests

This is a short check of server-side resources used by DeMomentSomTres Address
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.74 ▲1.2213.12 ▼41.29
Dashboard /wp-admin4.76 ▲1.3413.50 ▼20.37
Posts /wp-admin/edit.php4.76 ▲1.1112.28 ▼27.23
Add New Post /wp-admin/post-new.php4.76 ▼2.2213.50 ▼1,249.89
Media Library /wp-admin/upload.php4.76 ▲1.4611.67 ▼19.83
Microdata Address /wp-admin/options-general.php?page=dmst_address4.7612.71
Freemius Debug [v.1.2.1.5] /wp-admin/admin.php?page=freemius4.7613.84

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 125 new files
Database: no new tables, 4 new options
New WordPress options
fs_debug_mode
fs_accounts
fs_api_cache
fs_active_plugins

Browser metrics Passed 4 tests

Checking browser requirements for DeMomentSomTres Address
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,843 ▲8915.78 ▲0.696.14 ▼0.142.41 ▲0.16
Dashboard /wp-admin2,949 ▲956.13 ▼0.09127.01 ▼13.83280.45 ▲101.77
Posts /wp-admin/edit.php2,749 ▲553.23 ▼0.0165.28 ▲1.21207.35 ▲61.85
Add New Post /wp-admin/post-new.php1,699 ▲3815.96 ▼1.15439.84 ▲0.60163.78 ▼31.76
Media Library /wp-admin/upload.php1,754 ▲595.50 ▼0.04147.92 ▲11.15284.84 ▲87.37
Microdata Address /wp-admin/options-general.php?page=dmst_address1,4592.4153.92178.66
Freemius Debug [v.1.2.1.5] /wp-admin/admin.php?page=freemius280.940.0316.98

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/demomentsomtres-address/freemius/includes/managers/class-fs-admin-menu-manager.php+123
    Undefined index: slug
  • Zombie WordPress options detected upon uninstall: 4 options
    • fs_active_plugins
    • fs_api_cache
    • fs_accounts
    • fs_debug_mode

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=freemius
    • > Notice in wp-content/plugins/demomentsomtres-address/freemius/includes/managers/class-fs-admin-menu-manager.php+123
    Undefined index: slug
    • > GET request to /wp-admin/options-general.php?page=dmst_address
    • > User deprecated in wp-includes/functions.php+5326
    screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=dmst_address
    • > User deprecated in wp-includes/functions.php+5326
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 30 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=dmst_address
    • > Notice in wp-content/plugins/demomentsomtres-address/admin.php+324
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/demomentsomtres-address/admin.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=freemius
    • > Network (severe)
    wp-admin/admin.php?page=freemius - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (The plugin content in our web page http://demomentsomtres.com), #2 (The plugin admin page)
You can take inspiration from this readme.txt

demomentsomtres-address/demomentsomtres-address.php Passed 13 tests

Analyzing the main PHP file in "DeMomentSomTres Address" version 2.1
82 characters long description:
DeMomentSomTres Address helps you insert your address using microdata on your web.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected20,547 lines of code in 112 files:
LanguageFilesBlank linesComment linesLines of code
PHP773,3708,17514,786
PO File41,4221,4393,651
Sass15267821,636
JavaScript43763229
Markdown1610192
JSON20042
CSS90011

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please tend to the following items
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 1,019)
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity43.28
▷ Minimum class complexity1.00
▷ Maximum class complexity1,019.00
Average method complexity3.43
▷ Minimum method complexity1.00
▷ Maximum method complexity73.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes36
▷ Abstract classes25.56%
▷ Concrete classes3494.44%
▷ Final classes00.00%
Methods655
▷ Static methods9013.74%
▷ Public methods48574.05%
▷ Protected methods121.83%
▷ Private methods15824.12%
Functions103
▷ Named functions9895.15%
▷ Anonymous functions54.85%
Constants98
▷ Global constants8182.65%
▷ Class constants1717.35%
▷ Public constants17100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.16MB with 0.09MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png45.14KB16.45KB▼ 63.55%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
screenshot-1.png108.33KB38.84KB▼ 64.15%