10% wpinvoice

Code Review | wpinvoice

WordPress plugin wpinvoice scored 10% from 54 tests.

About plugin

  • Plugin page: wpinvoice
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.4-3.0.4
  • WordPress version: 6.3.1
  • First release: Jul 13, 2011
  • Latest release: Jul 13, 2011
  • Number of updates: 5
  • Update frequency: every 66.8 days
  • Top authors: Eoxia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,379 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/eoinvoice_settings.class.php+5
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_settings has a deprecated constructor

Server metrics [RAM: ▼1.64MB] [CPU: ▼48.41ms] Passed 4 tests

This is a short check of server-side resources used by wpinvoice
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.34 ▼1.125.33 ▼35.65
Dashboard /wp-admin2.36 ▼0.946.22 ▼39.90
Posts /wp-admin/edit.php2.37 ▼0.986.22 ▼39.32
Add New Post /wp-admin/post-new.php2.36 ▼3.526.92 ▼78.77
Media Library /wp-admin/upload.php2.36 ▼0.8744.08 ▲10.72
Web-service /wp-admin/admin.php?page=eoinvoice_menu_service2.367.27
Nouvelle facture /wp-admin/admin.php?page=eoinvoice_menu_entry2.366.84
Nouveau magasin /wp-admin/admin.php?page=eoinvoice_menu_store_creation2.366.36
Tableau de bord /wp-admin/admin.php?page=eoinvoice_menu_stats2.367.82
Consultation /wp-admin/admin.php?page=eoinvoice_menu2.367.67
Réglages magasin /wp-admin/admin.php?page=eoinvoice_menu_settings2.368.02

Server storage [IO: ▲1.31MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 100 new files
Database: 5 new tables, 7 new options
New tables
wp_eoinvoice__store_list
wp_eoinvoice__user_store
wp_eoinvoice__ged_documents
wp_eoinvoice__adress
wp_eoinvoice__user_adress
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
eoinvoice_db_version
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

wpinvoice: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,935 ▲20014.07 ▼0.525.12 ▲3.5336.11 ▼4.05
Dashboard /wp-admin2,242 ▲514.89 ▲0.0597.49 ▼6.4165.84 ▲24.83
Posts /wp-admin/edit.php2,140 ▲512.03 ▲0.0138.27 ▲0.3834.51 ▼0.18
Add New Post /wp-admin/post-new.php1,707 ▲17420.42 ▼2.39666.99 ▲9.6949.09 ▼4.45
Media Library /wp-admin/upload.php1,433 ▲454.23 ▼0.05111.52 ▼2.3473.24 ▲24.06
Web-service /wp-admin/admin.php?page=eoinvoice_menu_service8372.0326.3125.05
Nouvelle facture /wp-admin/admin.php?page=eoinvoice_menu_entry8192.0324.4823.88
Nouveau magasin /wp-admin/admin.php?page=eoinvoice_menu_store_creation8542.0723.3425.19
Tableau de bord /wp-admin/admin.php?page=eoinvoice_menu_stats8222.0325.5526.86
Consultation /wp-admin/admin.php?page=eoinvoice_menu8222.0623.6625.43
Réglages magasin /wp-admin/admin.php?page=eoinvoice_menu_settings8192.0826.4925.78

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/eoinvoice_settings.class.php+5
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_settings has a deprecated constructor
  • This plugin does not fully uninstall, leaving 5 tables in the database
    • wp_eoinvoice__ged_documents
    • wp_eoinvoice__store_list
    • wp_eoinvoice__user_adress
    • wp_eoinvoice__user_store
    • wp_eoinvoice__adress
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • eoinvoice_db_version
    • widget_recent-posts

Smoke tests 50% 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
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/eoinvoice_settings.class.php+5
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_settings has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/eoinvoice_front.class.php+4
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_front has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/eoinvoice_entry.class.php+4
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_entry has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/eoinvoice_customer.class.php+4
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_customer has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/eoinvoice_store_creation.class.php+6
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_store_creation has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/eoinvoice_service.class.php+5
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_service has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/eoinvoice_init.class.php+4
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_init has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/eoinvoice_stats.class.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_stats has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/db/eoinvoice_invoice_table.class.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_invoice_table has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/eoinvoice_tools.class.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_tools has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/eoinvoice_export_odt.class.php+5
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_export_odt has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/eoinvoice_export_pdf.class.php+8
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_export_pdf has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Notice in wp-content/plugins/wpinvoice/include/lib/eoinvoice_export_pdf.class.php+2
    Constant EURO already defined
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/pdf/fpdf.php+12
    Methods with the same name as their class will not be constructors in a future version of PHP; FPDF has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/eoinvoice_export_html.class.php+2
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_export_html has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/db/eoinvoice_store_table.class.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_store_table has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/db/eoinvoice_adress_table.class.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_adress_table has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/db/eoinvoice_user_adress_table.class.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_user_adress_table has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/db/eoinvoice_store_list_table.class.php+5
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_store_list_table has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/db/eoinvoice_user_store_table.class.php+4
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_user_store_table has a deprecated constructor
  • 156 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Warning in wp-content/plugins/wpinvoice/include/lib/db/eoinvoice_user_adress_table.class.php+14
    Use of undefined constant EOI_TABLE_USER_ADRESS - assumed 'EOI_TABLE_USER_ADRESS' (this will throw an Error in a future version of PHP)
  • 180 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Warning in wp-content/plugins/wpinvoice/include/lib/db/eoinvoice_user_store_table.class.php+21
    Use of undefined constant EOI_TABLE_USER_STORE - assumed 'EOI_TABLE_USER_STORE' (this will throw an Error in a future version of PHP)
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/odt/zip/pclzip/pclzip.lib.php+190
    Methods with the same name as their class will not be constructors in a future version of PHP; PclZip has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Notice in wp-content/plugins/wpinvoice/include/lib/odt/zip/pclzip/pclzip.lib.php+1972
    A non well formed numeric value encountered
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/db/eoinvoice_invoice_row_table.class.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_invoice_row_table has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/pdf/fpdf.php+1073
    Function get_magic_quotes_runtime() is deprecated
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/db/eoinvoice_ged_documents_table.class.php+4
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_ged_documents_table has a deprecated constructor
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Deprecated in wp-content/plugins/wpinvoice/include/lib/eoinvoice_view_save.class.php+4
    Methods with the same name as their class will not be constructors in a future version of PHP; eoinvoice_view_save has a deprecated constructor
  • 18 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Notice in wp-content/plugins/wpinvoice/include/config/configNomTables.php+15
    Undefined variable: store_number
  • 30 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > User deprecated in wp-includes/functions.php+5453
    Function get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead.
  • 36 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • 36 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > Notice in wp-content/plugins/wpinvoice/include/lib/eoinvoice_init.class.php+127
    Undefined variable: empty_store
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_settings
    • > User deprecated in wp-includes/functions.php+5737
    Function WP_User->id was called with an argument that is deprecated since version 2.1.0! Use WP_User->ID instead.
    • > GET request to /wp-admin/admin.php?page=eoinvoice_menu_store_creation
    • > Notice in wp-content/plugins/wpinvoice/include/lib/eoinvoice_store_creation.class.php+39
    Undefined index: eoinvoice_hidden

SRP 50% 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
Please fix the following
  • 20× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wpinvoice/eoinvoice.php on line 36
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wpinvoice/include/config/configNomTables.php on line 34
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wpinvoice/include/config/configNomTables.php on line 30
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wpinvoice/include/config/configNomTables.php on line 36
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wpinvoice/include/config/configNomTables.php on line 32
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wpinvoice/eoinvoice.php on line 35
    • > PHP Notice
      Undefined variable: store_number in wp-content/plugins/wpinvoice/include/config/configNomTables.php on line 15
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wpinvoice/include/config/configNomTables.php on line 24
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wpinvoice/include/config/configNomTables.php on line 28
    • > PHP Fatal error
      require_once(): Failed opening required 'EOINVOICE_HOME_DIRinclude/lib/pdf/fpdf.php' (include_path='.:/usr/share/php') in wp-content/plugins/wpinvoice/include/lib/eoinvoice_export_pdf.class.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

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
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (Interface de consultation des factures pour un magasin) image missing
The official readme.txt is a good inspiration

wpinvoice/eoinvoice.php 92% from 13 tests

The primary PHP file in "wpinvoice" version 0.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wpinvoice.php" instead of "eoinvoice.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected9,478 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
PHP451,7844,1359,031
HTML2600195
CSS2110164
XML21055
JavaScript13633

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.34
Average class complexity42.39
▷ Minimum class complexity1.00
▷ Maximum class complexity551.00
Average method complexity5.10
▷ Minimum method complexity1.00
▷ Maximum method complexity79.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes32
▷ Abstract classes00.00%
▷ Concrete classes32100.00%
▷ Final classes00.00%
Methods338
▷ Static methods00.00%
▷ Public methods33398.52%
▷ Protected methods10.30%
▷ Private methods41.18%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants66
▷ Global constants6496.97%
▷ Class constants23.03%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
25 PNG files occupy 0.61MB with 0.35MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
manuel/img/storesettings2.png30.74KB10.96KB▼ 64.34%
manuel/etape2.png8.42KB3.71KB▼ 55.89%
manuel/img/exporthtml.png50.48KB20.87KB▼ 58.66%
manuel/img/newstore.png12.24KB5.12KB▼ 58.14%
manuel/img/menuclient.png5.94KB3.02KB▼ 49.09%