46% pafacile

Code Review | PAFacile

WordPress plugin PAFacile scored46%from 54 tests.

About plugin

  • Plugin page: pafacile
  • Plugin version: 2.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-3.9.1
  • WordPress version: 6.3.1
  • First release: Nov 4, 2011
  • Latest release: Jun 16, 2014
  • Number of updates: 40
  • Update frequency: every 23.9 days
  • Top authors: tosend.it (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /6,628 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.89MB] [CPU: ▼35.03ms] Passed 4 tests

This is a short check of server-side resources used by PAFacile
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0125.83 ▼12.23
Dashboard /wp-admin3.05 ▼0.2522.38 ▼25.84
Posts /wp-admin/edit.php3.06 ▼0.3025.04 ▼24.18
Add New Post /wp-admin/post-new.php3.05 ▼2.8323.97 ▼76.59
Media Library /wp-admin/upload.php3.05 ▼0.1721.38 ▼13.50
Informazioni /wp-admin/admin.php?page=tosendit-pa3.0624.01
Configurazione /wp-admin/admin.php?page=tosendit-pa?settings3.0624.35

Server storage [IO: ▲0.97MB] [DB: ▲0.02MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 155 new files
Database: 15 new tables, 8 new options
New tables
wp_pa_users2org
wp_pa_organigramma
wp_tosendit_log
wp_pa_ordinanze
wp_pa_tipo_atto
wp_pa_sovvenzioni
wp_pa_delibere
wp_pa_organi_rel
wp_pa_incarichi
wp_pa_determine
...
New WordPress options
can_compress_scripts
widget_theysaidso_widget
PAFacile_dbVersion
theysaidso_admin_options
widget_recent-posts
PAFacile_Credits
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

PAFacile: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲8814.47 ▲0.021.65 ▼0.1343.42 ▲1.80
Dashboard /wp-admin2,235 ▲444.94 ▲0.06100.81 ▼3.3365.24 ▲22.53
Posts /wp-admin/edit.php2,118 ▲262.01 ▼0.0338.65 ▼0.7537.66 ▲3.28
Add New Post /wp-admin/post-new.php1,536 ▲1723.21 ▲0.04696.77 ▲47.0044.39 ▼23.00
Media Library /wp-admin/upload.php1,417 ▲264.12 ▼0.0796.36 ▼1.3970.04 ▲26.92
Informazioni /wp-admin/admin.php?page=tosendit-pa1,2831.9528.1532.11
Configurazione /wp-admin/admin.php?page=tosendit-pa?settings2,4751.9241.1154.33

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method toSendItPAFacile::doSave() should not be called statically
  • The uninstall procedure failed, leaving 15 tables in the database
    • wp_pa_ordinanze
    • wp_tosendit_log
    • wp_tosendit_attachs
    • wp_pa_delibere
    • wp_pa_sovvenzioni
    • wp_pa_bandi
    • wp_pa_organi
    • wp_pa_determine
    • wp_pa_tipo_atto
    • wp_pa_organigramma
    • ...
  • Zombie WordPress options detected upon uninstall: 8 options
    • PAFacile_Credits
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • PAFacile_dbVersion

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method toSendItPAFacile::doSave() should not be called statically
    • > GET request to /wp-admin/admin.php?page=tosendit-pa
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method PAFacilePages::pageWelcome() should not be called statically
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+421
    Undefined variable: albopretorio_id
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+430
    Undefined variable: AlboPretorioPrivacy
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+454
    Undefined variable: certificazione_pubblicazione_1
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+475
    Undefined variable: certificazione_pubblicazione_0
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Deprecated in wp-content/plugins/pafacile/toSendItPAFacilePages.php+630
    Non-static method PAFacilePages::pageSettingsMetadata() should not be called statically
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+492
    Undefined variable: albopretorio_ldc
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+492
    Undefined variable: albopretorio_ddc
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+504
    Undefined variable: bandi_id
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+508
    Undefined variable: bandi_ldc
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+508
    Undefined variable: bandi_ddc
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+520
    Undefined variable: delibere_id
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+524
    Undefined variable: delibere_ldc
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+524
    Undefined variable: delibere_ddc
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+536
    Undefined variable: determine_id
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+540
    Undefined variable: determine_ldc
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+540
    Undefined variable: determine_ddc
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+552
    Undefined variable: incarichi_id
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+566
    Undefined variable: incarichi_ldc
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+566
    Undefined variable: incarichi_ddc
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+578
    Undefined variable: ordinanze_id
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+582
    Undefined variable: ordinanze_ldc
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+582
    Undefined variable: ordinanze_ddc
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+594
    Undefined variable: organi_id
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+598
    Undefined variable: organi_ldc
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+598
    Undefined variable: organi_ddc
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+610
    Undefined variable: organigramma_id
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+614
    Undefined variable: organigramma_ldc
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+614
    Undefined variable: organigramma_ddc
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+626
    Undefined variable: sovvenzioni_id
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+626
    Undefined variable: rispostaSovvenzioni
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+630
    Undefined variable: sovvenzioni_ldc
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+630
    Undefined variable: sovvenzioni_ddc
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+712
    Undefined variable: LivelloHeader
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tosendit-pa?settings
    • > Notice in wp-content/plugins/pafacile/toSendItPAFacilePages.php+727
    Undefined variable: addDoublinCoreHeaders

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 32× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/pafacile/delibere/dettaglio.php
    • > /wp-content/plugins/pafacile/tipiOrgani/elenco.php
    • > /wp-content/plugins/pafacile/welcome.php
    • > /wp-content/plugins/pafacile/ordinanze/elenco.php
    • > /wp-content/plugins/pafacile/incarichiProfessionali/dettaglio.php
    • > /wp-content/plugins/pafacile/alboPretorio/elenco.php
    • > /wp-content/plugins/pafacile/delibere/elenco.php
    • > /wp-content/plugins/pafacile/public-contents/BandiGare.php
    • > /wp-content/plugins/pafacile/ordinanze/dettaglio.php
    • > /wp-content/plugins/pafacile/public-contents/AlboPretorio.php
  • 22× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'WP_PLUGIN_DIR/pafacile/toSendIt.php' (include_path='.:/usr/share/php') in wp-content/plugins/pafacile/tosendit-pa.php on line 42
    • > PHP Warning
      Use of undefined constant TOSENDIT_PAFACILE_ORDINANZE_HANDLER - assumed 'TOSENDIT_PAFACILE_ORDINANZE_HANDLER' (this will throw an Error in a future version of PHP) in wp-content/plugins/pafacile/doSave.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pafacile/mce/plugins.php:31
    • > PHP Warning
      Use of undefined constant PAFACILE_PLUING_DIRECTORY - assumed 'PAFACILE_PLUING_DIRECTORY' (this will throw an Error in a future version of PHP) in wp-content/plugins/pafacile/google-analytics/index.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pafacile/ajax/actions.php:3
    • > PHP Warning
      Use of undefined constant TOSENDIT_PAFACILE_DETERMINE_HANDLER - assumed 'TOSENDIT_PAFACILE_DETERMINE_HANDLER' (this will throw an Error in a future version of PHP) in wp-content/plugins/pafacile/doSave.php on line 6
    • > PHP Warning
      Use of undefined constant TOSENDIT_PAFACILE_BANDI_HANDLER - assumed 'TOSENDIT_PAFACILE_BANDI_HANDLER' (this will throw an Error in a future version of PHP) in wp-content/plugins/pafacile/doSave.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pafacile/PAFacileOpenData.php:6
    • > PHP Fatal error
      require_once(): Failed opening required 'PAFACILE_PLUING_DIRECTORY/google-analytics/api.php' (include_path='.:/usr/share/php') in wp-content/plugins/pafacile/google-analytics/index.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'toSendItGenericMethods' not found in wp-content/plugins/pafacile/definitions.php:139

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=tosendit-pa
    • > Network (severe)
    http://www.tosend.it/images/logo.gif - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Una delle pagine di configuraizione di PAFacile), #2 (Particolare della scheda dell'albo pretorio on-line), #3 (Particolare della scheda della gestione dei bandi di gara, concorsi e graduatorie), #4 (Altro particolare della scheda di gestione per i Bandi di gara, concorsi e graduatorie)
  • Tags: There are too many tags (11 tag instead of maximum 10)
You can take inspiration from this readme.txt

pafacile/tosendit-pa.php 85% from 13 tests

Analyzing the main PHP file in "PAFacile" version 2.6.1
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 426 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("pafacile.php" instead of "tosendit-pa.php")

Code Analysis Passed 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 detected12,756 lines of code in 65 files:
LanguageFilesBlank linesComment linesLines of code
PHP541,2871,03510,036
JavaScript6188981,970
CSS513126750

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity32.81
▷ Minimum class complexity1.00
▷ Maximum class complexity101.00
Average method complexity5.99
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes26
▷ Abstract classes00.00%
▷ Concrete classes26100.00%
▷ Final classes00.00%
Methods176
▷ Static methods15386.93%
▷ Public methods15990.34%
▷ Protected methods52.84%
▷ Private methods126.82%
Functions62
▷ Named functions62100.00%
▷ Anonymous functions00.00%
Constants96
▷ Global constants96100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
48 PNG files occupy 0.34MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ft/ppt.png2.40KB2.04KB▼ 15.18%
mce/img/ordinanze_box.png6.12KB2.93KB▼ 52.06%
screenshot-4.png23.64KB9.20KB▼ 61.09%
images/delibere.png0.62KB0.75KB0.00%
images/ft/unknown.png0.93KB0.85KB▼ 7.99%