52% enefti-nft-marketplace-core-lite

Code Review | Enefti NFT Marketplace Core lite

WordPress plugin Enefti NFT Marketplace Core lite scored52%from 54 tests.

About plugin

  • Plugin page: enefti-nft-market...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Dec 9, 2022
  • Latest release: Jun 7, 2023
  • Number of updates: 10
  • Update frequency: every 18.1 days
  • Top authors: modelthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /2,693 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲2.56MB] [CPU: ▲16.35ms] Passed 4 tests

Analyzing server-side resources used by Enefti NFT Marketplace Core lite
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /6.00 ▲2.5459.14 ▲23.24
Dashboard /wp-admin5.87 ▲2.5662.87 ▲14.00
Posts /wp-admin/edit.php5.95 ▲2.5970.42 ▲26.13
Add New Post /wp-admin/post-new.php8.49 ▲2.60101.89 ▲5.80
Media Library /wp-admin/upload.php5.79 ▲2.5556.97 ▲22.35
Categories /wp-admin/edit-tags.php?taxonomy=nft-listing-category&post_type=nft-listing5.7955.96
Currencies /wp-admin/edit-tags.php?taxonomy=nft-listing-currency&post_type=nft-listing5.7950.22
NFT Listings /wp-admin/edit.php?post_type=nft-listing5.8351.29
Blockchains /wp-admin/edit-tags.php?taxonomy=nft_listing_blockchains&post_type=nft-listing5.7947.27
Add NFT /wp-admin/post-new.php?post_type=nft-listing6.3467.91
Collections /wp-admin/edit-tags.php?taxonomy=nft-listing-collection&post_type=nft-listing5.7949.02

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 155 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
nft-marketplace-core-version
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Enefti NFT Marketplace Core lite
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,245 ▲51015.29 ▲0.8931.12 ▲28.8843.52 ▲0.27
Dashboard /wp-admin2,267 ▲795.91 ▲0.02110.99 ▼4.7583.53 ▲36.30
Posts /wp-admin/edit.php2,168 ▲792.25 ▲0.2539.55 ▲4.7536.60 ▲1.50
Add New Post /wp-admin/post-new.php1,575 ▲4223.23 ▲0.03762.41 ▲97.4336.83 ▼12.70
Media Library /wp-admin/upload.php1,452 ▲614.30 ▲0.0994.33 ▼7.0779.37 ▲35.23
Categories /wp-admin/edit-tags.php?taxonomy=nft-listing-category&post_type=nft-listing1,3392.3931.5229.12
Currencies /wp-admin/edit-tags.php?taxonomy=nft-listing-currency&post_type=nft-listing1,3822.2731.3430.57
NFT Listings /wp-admin/edit.php?post_type=nft-listing1,1692.2031.8932.19
Blockchains /wp-admin/edit-tags.php?taxonomy=nft_listing_blockchains&post_type=nft-listing1,3932.4031.1129.38
Add NFT /wp-admin/post-new.php?post_type=nft-listing2,6274.5380.6691.46
Collections /wp-admin/edit-tags.php?taxonomy=nft-listing-collection&post_type=nft-listing1,3362.2730.3326.12

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Error in wp-content/plugins/enefti-nft-marketplace-core-lite/uninstall.php+117
    Uncaught Error: Call to a member function remove_cap() on array in wp-content/plugins/enefti-nft-marketplace-core-lite/uninstall.php:117
    Stack trace:
    #0 wp-content/plugins/enefti-nft-marketplace-core-lite/uninstall.php(51): nft_marketplace_core_uninstall()
    #1 wp-content/plugins/enefti-nft-marketplace-core-lite/uninstall.php(122): nft_marketplace_core_uninstall_multisite()
    #2 wp-admin/includes/plugin.php(1245): include_once('/var/www/wordpr...')
    #3 wp-admin/includes/plugin.php(960): uninstall_plugin()
  • The plugin did not uninstall successfully, leaving 155 files (7.03MB) in the plugin directory
    • (new file) assets/css/datatables.css
    • (new file) LICENSE.txt
    • (new file) assets/css/bootstrap-grid.min.css
    • (new file) assets/css/fonts/font-awesome/all.min.css
    • (new file) assets/css/bootstrap-grid.css.map
    • (new file) assets/css/bootstrap-grid.min.css.map
    • (new file) assets/css/datatables.min.css
    • (new file) assets/css/bootstrap-grid.css
    • (new file) .gitignore
    • (new file) assets/banner-772x250.png
    • ...
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent
    • theysaidso_admin_options
    • nft-marketplace-core-version
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 12× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/enefti-nft-marketplace-core-lite/internals/shortcodes/helpers.swiper.nft.php
    • > /wp-content/plugins/enefti-nft-marketplace-core-lite/vendor/drlecks/simple-web3-php/Example/example.batch.php
    • > /wp-content/plugins/enefti-nft-marketplace-core-lite/vendor/drlecks/simple-web3-php/Example/example.account.php
    • > /wp-content/plugins/enefti-nft-marketplace-core-lite/vendor/micropackage/requirements/tests/bootstrap.php
    • > /wp-content/plugins/enefti-nft-marketplace-core-lite/internals/shortcodes/listings-category/listings-category.php
    • > /wp-content/plugins/enefti-nft-marketplace-core-lite/vendor/drlecks/simple-web3-php/Example/example.contract_creation.php
    • > /wp-content/plugins/enefti-nft-marketplace-core-lite/nft-marketplace-core-lite.php
    • > /wp-content/plugins/enefti-nft-marketplace-core-lite/vendor/drlecks/simple-web3-php/Example/example.send.php
    • > /wp-content/plugins/enefti-nft-marketplace-core-lite/internals/shortcodes/nft-category-group/nft-category-group.php
    • > /wp-content/plugins/enefti-nft-marketplace-core-lite/vendor/drlecks/simple-web3-php/Example/example.call.php
  • 366× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/enefti-nft-marketplace-core-lite/vendor/cmb2/includes/types/CMB2_Type_File_List.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Mdanter\\Ecc\\Crypto\\Signature\\SignatureInterface' not found in wp-content/plugins/enefti-nft-marketplace-core-lite/vendor/kornrunner/secp256k1/src/Signature/SignatureInterface.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/enefti-nft-marketplace-core-lite/vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/enefti-nft-marketplace-core-lite/vendor/micropackage/requirements/src/notice.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/enefti-nft-marketplace-core-lite/vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/enefti-nft-marketplace-core-lite/vendor/cmb2/includes/types/CMB2_Type_Oembed.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'NFT_Marketplace_Core_Lite\\Engine\\Base' not found in wp-content/plugins/enefti-nft-marketplace-core-lite/backend/PageNames.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'FG\\ASN1\\AbstractTime' not found in wp-content/plugins/enefti-nft-marketplace-core-lite/vendor/fgrosse/phpasn1/lib/ASN1/Universal/UTCTime.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/enefti-nft-marketplace-core-lite/vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'NFT_Marketplace_Core_Lite\\Engine\\Base' not found in wp-content/plugins/enefti-nft-marketplace-core-lite/internals/tax-meta/CUR_TAX_META.php:10

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)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/edit-tags.php?taxonomy=nft-listing-category&post_type=nft-listing
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'editor')" "TypeError: Cannot read properties of undefined (reading 'editor')\n at ct_media_upload (/wp-admin/edit-tags.php?taxonomy=nft-listing-category&post_type=nft-listing:368:58)\n at HTMLDocument.\u003Canonymous> (/wp-admin/edit-tags.php?taxonomy=nft-listing-category&post_type=nft-listing:388:17)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=nft-listing-collection&post_type=nft-listing
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: Cannot read properties of undefined (reading 'editor')
    • > GET request to /wp-admin/edit-tags.php?taxonomy=nft-listing-currency&post_type=nft-listing
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'editor')" "TypeError: Cannot read properties of undefined (reading 'editor')\n at ct_media_upload (/wp-admin/edit-tags.php?taxonomy=nft-listing-currency&post_type=nft-listing:387:58)\n at HTMLDocument.\u003Canonymous> (/wp-admin/edit-tags.php?taxonomy=nft-listing-currency&post_type=nft-listing:407:17)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/edit-tags.php?taxonomy=nft_listing_blockchains&post_type=nft-listing
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'editor')" "TypeError: Cannot read properties of undefined (reading 'editor')\n at ct_media_upload (/wp-admin/edit-tags.php?taxonomy=nft_listing_blockchains&post_type=nft-listing:393:58)\n at HTMLDocument.\u003Canonymous> (/wp-admin/edit-tags.php?taxonomy=nft_listing_blockchains&post_type=nft-listing:413:17)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/edit-tags.php?taxonomy=nft-listing-collection&post_type=nft-listing
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'editor')" "TypeError: Cannot read properties of undefined (reading 'editor')\n at ct_media_upload (/wp-admin/edit-tags.php?taxonomy=nft-listing-collection&post_type=nft-listing:368:58)\n at HTMLDocument.\u003Canonymous> (/wp-admin/edit-tags.php?taxonomy=nft-listing-collection&post_type=nft-listing:388:17)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 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
10 plugin tags: ethereum, smart contract, erc721, blockchain, polygon...

enefti-nft-marketplace-core-lite/nft-marketplace-core-lite.php 77% from 13 tests

The main PHP file in "Enefti NFT Marketplace Core lite" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Git Repository: A Git repository was detected inside this plugin
  • Main file name: Name the main plugin file the same as the plugin slug ("enefti-nft-marketplace-core-lite.php" instead of "nft-marketplace-core-lite.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected156,491 lines of code in 840 files:
LanguageFilesBlank linesComment linesLines of code
PHP53113,09229,64366,261
PO File12114,32418,51332,369
JavaScript193,4988,49816,698
SVG1001214,230
CSS341,7181,36813,600
JSON351407,928
Markdown3499902,686
Sass17306291,411
YAML2013342678
XML13167302
Solidity25015149
Bourne Shell22111128
make217051

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
It is recommended to fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 109)
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity18.02
▷ Minimum class complexity1.00
▷ Maximum class complexity634.00
Average method complexity3.54
▷ Minimum method complexity1.00
▷ Maximum method complexity109.00
Code structure
Namespaces88
Interfaces21
Traits2
Classes470
▷ Abstract classes255.32%
▷ Concrete classes44594.68%
▷ Final classes40.90%
Methods3,429
▷ Static methods45613.30%
▷ Public methods3,06089.24%
▷ Protected methods2547.41%
▷ Private methods1153.35%
Functions209
▷ Named functions16880.38%
▷ Anonymous functions4119.62%
Constants397
▷ Global constants5914.86%
▷ Class constants33885.14%
▷ Public constants32495.86%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
22 compressed PNG files occupy 0.44MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
vendor/cmb2/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
vendor/cmb2/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
vendor/cmb2/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
vendor/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%