10% wpklikandpay

Code Review | wpklikandpay

WordPress plugin wpklikandpay scored10%from 54 tests.

About plugin

  • Plugin page: wpklikandpay
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.4-3.5
  • WordPress version: 6.3.1
  • First release: Jul 13, 2011
  • Latest release: Jan 21, 2013
  • Number of updates: 5
  • Update frequency: every 111.6 days
  • Top authors: Eoxia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,696 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/wpklikandpay/includes/librairies/options/db_options.class.php+17
    Methods with the same name as their class will not be constructors in a future version of PHP; wpklikandpay_db_option has a deprecated constructor

Server metrics [RAM: ▼2.19MB] [CPU: ▼61.47ms] Passed 4 tests

A check of server-side resources used by wpklikandpay
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.665.73 ▼41.35
Dashboard /wp-admin2.09 ▼1.477.24 ▼48.31
Posts /wp-admin/edit.php2.09 ▼1.597.23 ▼46.28
Add New Post /wp-admin/post-new.php2.09 ▼4.056.29 ▼109.92
Media Library /wp-admin/upload.php2.09 ▼1.405.80 ▼33.13
Formulaires /wp-admin/admin.php?page=wpklikandpay_forms2.096.63
Commandes /wp-admin/admin.php?page=wpklikandpay_orders2.098.01
Offres /wp-admin/admin.php?page=wpklikandpay_offers2.096.03
Klik and Pay /wp-admin/options-general.php?page=wpklikandpay_options2.106.12

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 42 new files
Database: 4 new tables, 9 new options
New tables
wp_klikandpay__forms
wp_klikandpay__orders
wp_klikandpay__forms_offers_link
wp_klikandpay__offers
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
wpklikandpay_store_mainoption
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
wpklikandpay_db_option
wpklikandpay_store_urloption

Browser metrics Passed 4 tests

An overview of browser requirements for wpklikandpay
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,919 ▲15813.46 ▼0.928.49 ▲6.5840.31 ▼5.91
Dashboard /wp-admin2,235 ▲585.66 ▼0.0186.77 ▼7.7440.66 ▲2.19
Posts /wp-admin/edit.php2,143 ▲432.03 ▲0.0039.46 ▲0.1936.68 ▼1.54
Add New Post /wp-admin/post-new.php1,571 ▲2618.29 ▼4.86659.01 ▼32.1555.43 ▲3.44
Media Library /wp-admin/upload.php1,446 ▲464.25 ▲0.0497.69 ▼8.4144.99 ▼4.41
Formulaires /wp-admin/admin.php?page=wpklikandpay_forms8631.9325.4429.27
Commandes /wp-admin/admin.php?page=wpklikandpay_orders8911.9327.1829.30
Offres /wp-admin/admin.php?page=wpklikandpay_offers8811.7325.2625.43
Klik and Pay /wp-admin/options-general.php?page=wpklikandpay_options8811.7324.5022.74

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 25% 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
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/wpklikandpay/includes/librairies/options/db_options.class.php+17
    Methods with the same name as their class will not be constructors in a future version of PHP; wpklikandpay_db_option has a deprecated constructor
  • The plugin did not uninstall successfully, leaving 4 tables in the database
    • wp_klikandpay__forms_offers_link
    • wp_klikandpay__forms
    • wp_klikandpay__offers
    • wp_klikandpay__orders
  • Zombie WordPress options were found after uninstall: 9 options
    • wpklikandpay_db_option
    • widget_theysaidso_widget
    • wpklikandpay_store_mainoption
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • wpklikandpay_store_urloption
    • widget_recent-posts
    • widget_recent-comments

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)
Please fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wpklikandpay_options
    • > Deprecated in wp-content/plugins/wpklikandpay/includes/librairies/options/db_options.class.php+17
    Methods with the same name as their class will not be constructors in a future version of PHP; wpklikandpay_db_option has a deprecated constructor
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wpklikandpay_options
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method wpklikandpay_init::wpklikandpay_plugin_load() should not be called statically
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wpklikandpay_options
    • > Deprecated in wp-content/plugins/wpklikandpay/includes/librairies/init.class.php+39
    Non-static method wpklikandpay_database::wpklikandpay_db_update() should not be called statically
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wpklikandpay_options
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method wpklikandpay_init::wpklikandpay_front_css() should not be called statically
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wpklikandpay_options
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method wpklikandpay_init::wpklikandpay_front_js() should not be called statically
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wpklikandpay_options
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method wpklikandpay_init::wpklikandpay_menu() should not be called statically
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wpklikandpay_options
    • > Deprecated in wp-content/plugins/wpklikandpay/includes/librairies/init.class.php+72
    Non-static method wpklikandpay_orders::pageTitle() should not be called statically
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wpklikandpay_options
    • > Deprecated in wp-content/plugins/wpklikandpay/includes/librairies/init.class.php+73
    Non-static method wpklikandpay_payment_form::pageTitle() should not be called statically
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wpklikandpay_options
    • > Deprecated in wp-content/plugins/wpklikandpay/includes/librairies/init.class.php+74
    Non-static method wpklikandpay_offers::pageTitle() should not be called statically
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wpklikandpay_options
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method wpklikandpay_init::wpklikandpay_admin_css() should not be called statically
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wpklikandpay_options
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method wpklikandpay_init::wpklikandpay_admin_js() should not be called statically
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpklikandpay_offers
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method wpklikandpay_display::displayPage() should not be called statically
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpklikandpay_offers
    • > Deprecated in wp-content/plugins/wpklikandpay/includes/librairies/display.class.php+93
    Non-static method wpklikandpay_tools::varSanitizer() should not be called statically
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpklikandpay_offers
    • > Deprecated in wp-content/plugins/wpklikandpay/includes/librairies/display.class.php+141
    Non-static method wpklikandpay_display::getPageIconInformation() should not be called statically
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpklikandpay_offers
    • > 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.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpklikandpay_offers
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query does not contain the correct number of placeholders (0) for the number of arguments passed (1). Please see Debugging in WordPress for more information. (This message was added in version 4.8.3.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpklikandpay_offers
    • > Notice in wp-content/plugins/wpklikandpay/includes/librairies/offers.class.php+299
    Undefined variable: element
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpklikandpay_offers
    • > Notice in wp-content/plugins/wpklikandpay/includes/librairies/offers.class.php+299
    Trying to get property 'id' of non-object
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpklikandpay_offers
    • > Deprecated in wp-content/plugins/wpklikandpay/includes/librairies/offers.class.php+306
    Non-static method wpklikandpay_display::getTable() should not be called statically
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpklikandpay_offers
    • > Deprecated in wp-content/plugins/wpklikandpay/includes/librairies/display.class.php+174
    Non-static method wpklikandpay_display::displayPageHeader() should not be called statically
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpklikandpay_offers
    • > Deprecated in wp-content/plugins/wpklikandpay/includes/librairies/display.class.php+180
    Non-static method wpklikandpay_display::displayPageFooter() should not be called statically
    • > GET request to /wp-admin/admin.php?page=wpklikandpay_orders
    • > Notice in wp-content/plugins/wpklikandpay/includes/librairies/orders.class.php+124
    Undefined variable: actionResult
    • > GET request to /wp-admin/admin.php?page=wpklikandpay_offers
    • > Notice in wp-content/plugins/wpklikandpay/includes/librairies/offers.class.php+108
    Undefined index: wp_klikandpay__offers
    • > GET request to /wp-admin/admin.php?page=wpklikandpay_offers
    • > Notice in wp-content/plugins/wpklikandpay/includes/librairies/offers.class.php+108
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/admin.php?page=wpklikandpay_offers
    • > Notice in wp-content/plugins/wpklikandpay/includes/librairies/offers.class.php+109
    Undefined index: payment_recurrent_amount
    • > GET request to /wp-admin/options-general.php?page=wpklikandpay_options
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method wpklikandpay_option::doOptionsPage() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=wpklikandpay_options
    • > Deprecated in wp-admin/includes/template.php+1771
    Non-static method wpklikandpay_option::storeConfigForm() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=wpklikandpay_options
    • > Deprecated in wp-admin/includes/template.php+1824
    Non-static method wpklikandpay_option::storeTpe() should not be called statically
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wpklikandpay_options
    • > Deprecated in wp-content/plugins/wpklikandpay/includes/librairies/options/options.class.php+220
    Non-static method wpklikandpay_option::getStoreConfigOption() should not be called statically
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wpklikandpay_options
    • > Deprecated in wp-content/plugins/wpklikandpay/includes/librairies/options/options.class.php+228
    Non-static method wpklikandpay_form::check_input_type() should not be called statically
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wpklikandpay_options
    • > Notice in wp-content/plugins/wpklikandpay/includes/librairies/form.class.php+76
    Undefined index: option
    • > GET request to /wp-admin/options-general.php?page=wpklikandpay_options
    • > Notice in wp-content/plugins/wpklikandpay/includes/librairies/form.class.php+81
    Undefined index: valueToPut
    • > GET request to /wp-admin/options-general.php?page=wpklikandpay_options
    • > Deprecated in wp-content/plugins/wpklikandpay/includes/librairies/form.class.php+101
    Non-static method wpklikandpay_form::form_input() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=wpklikandpay_options
    • > Deprecated in wp-admin/includes/template.php+1824
    Non-static method wpklikandpay_option::environnement() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=wpklikandpay_options
    • > Deprecated in wp-content/plugins/wpklikandpay/includes/librairies/form.class.php+113
    Non-static method wpklikandpay_form::form_input_select() should not be called statically

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
  • 13× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'WP_PLUGIN_DIR/wpklikandpay/includes/configs/config.php' (include_path='.:/usr/share/php') in wp-content/plugins/wpklikandpay/wp-klikandpay.php on line 26
    • > 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/wpklikandpay/includes/configs/config.php on line 38
    • > PHP Warning
      Use of undefined constant WPKLIKANDPAY_PLUGIN_DIR - assumed 'WPKLIKANDPAY_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wpklikandpay/includes/configs/config.php on line 37
    • > PHP Warning
      require_once(WPKLIKANDPAY_LIB_PLUGIN_DIRpayment_forms.class.php): failed to open stream: No such file or directory in wp-content/plugins/wpklikandpay/includes/includes.php on line 39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wpklikandpay/includes/languages/db_filed_list.php:12
    • > 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/wpklikandpay/wp-klikandpay.php on line 26
    • > PHP Warning
      Use of undefined constant WPKLIKANDPAY_LIB_PLUGIN_DIR - assumed 'WPKLIKANDPAY_LIB_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wpklikandpay/includes/includes.php on line 39
    • > PHP Fatal error
      require_once(): Failed opening required 'WPKLIKANDPAY_LIB_PLUGIN_DIRpayment_forms.class.php' (include_path='.:/usr/share/php') in wp-content/plugins/wpklikandpay/includes/includes.php on line 39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/wpklikandpay/includes/configs/config.php:83
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wpklikandpay/includes/configs/config.php on line 59

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: klikpay, payment, klik and pay, klikandpay, pay...

wpklikandpay/wp-klikandpay.php 92% from 13 tests

The main file in "wpklikandpay" v. 1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wpklikandpay.php" instead of "wp-klikandpay.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected4,916 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP164019983,083
PO File2358462726
HTML200492
CSS349155442
JavaScript198173

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity43.00
▷ Minimum class complexity1.00
▷ Maximum class complexity120.00
Average method complexity5.67
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods99
▷ Static methods00.00%
▷ Public methods99100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
13 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
medias/jquery-ui/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
medias/jquery-ui/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
medias/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png0.14KB0.14KB0.00%
medias/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png0.15KB0.14KB▼ 6.62%
medias/jquery-ui/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%