74% nft-galleries

Code Review | NFT Galleries

WordPress plugin NFT Galleries scored74%from 54 tests.

About plugin

  • Plugin page: nft-galleries
  • Plugin version: 0.1.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.0
  • WordPress version: 6.3.1
  • First release: May 30, 2022
  • Latest release: Jun 9, 2022
  • Number of updates: 7
  • Update frequency: every 1.7 days
  • Top authors: Mekku (57.14%)rebelcode (57.14%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,034 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲1.32MB] [CPU: ▲11.39ms] Passed 4 tests

Server-side resources used by NFT Galleries
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.79 ▲1.3352.29 ▲9.87
Dashboard /wp-admin4.63 ▲1.3367.70 ▲21.64
Posts /wp-admin/edit.php4.68 ▲1.3363.55 ▲13.70
Add New Post /wp-admin/post-new.php7.40 ▲1.52110.41 ▲7.86
Media Library /wp-admin/upload.php4.49 ▲1.2753.22 ▲14.14

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 928 new files
Database: 3 new tables, 7 new options
New tables
wp_snft_galleries
wp_snft_tokens
wp_snft_wallets
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
snft_rest_api_auth_token
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for NFT Galleries
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲10813.16 ▼1.231.54 ▼0.5141.53 ▼3.79
Dashboard /wp-admin2,227 ▲365.82 ▼0.11119.81 ▲22.4846.66 ▲2.36
Posts /wp-admin/edit.php2,113 ▲212.01 ▼0.0541.71 ▲0.2536.34 ▼2.32
Add New Post /wp-admin/post-new.php1,567 ▲2323.86 ▲5.61679.29 ▲20.2239.12 ▼18.37
Media Library /wp-admin/upload.php1,412 ▲244.22 ▲0.0395.49 ▼19.7847.10 ▼2.20

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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 does not fully uninstall, leaving 3 tables in the database
    • wp_snft_galleries
    • wp_snft_tokens
    • wp_snft_wallets
  • Zombie WordPress options detected upon uninstall: 7 options
    • snft_rest_api_auth_token
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
  • 188× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'RebelCode\\Spotlight\ft\\Module' not found in wp-content/plugins/nft-galleries/modules/RestApiModule.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/nft-galleries/vendor/rebelcode/psr7/src/FnStream.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Dhii\\Collection\\CountableListInterface' not found in wp-content/plugins/nft-galleries/vendor/dhii/collections-interface/src/CountableSetInterface.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'RebelCode\\Spotlight\ft\\Module' not found in wp-content/plugins/nft-galleries/modules/WalletsModule.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Dhii\\Services\\Service' not found in wp-content/plugins/nft-galleries/src/core/Di/ArrayExtension.php:42
    • > PHP Fatal error
      Uncaught Error: Interface 'Interop\\Container\\ServiceProviderInterface' not found in wp-content/plugins/nft-galleries/vendor/dhii/containers/src/CompositeCachingServiceProvider.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\SimpleCache\\InvalidArgumentException' not found in wp-content/plugins/nft-galleries/vendor/wp-oop/transient-cache/src/Exception/InvalidArgumentException.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Dhii\\Collection\\ContainerInterface' not found in wp-content/plugins/nft-galleries/vendor/dhii/containers/src/HierarchyContainer.php:37
    • > PHP Fatal error
      Uncaught Error: Interface 'Dhii\\Transformer\\TransformerInterface' not found in wp-content/plugins/nft-galleries/src/core/RestApi/Transformers/FeedTransformer.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'RebelCode\\Spotlight\ft\\SaaS\\SaasResourceFetcher' not found in wp-content/plugins/nft-galleries/src/core/Feeds/Templates/FeedTemplatesProvider.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% 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
8 plugin tags: crypto, gallery, nft, opensea, ethereum...

nft-galleries/plugin.php 85% from 13 tests

The main PHP file in "NFT Galleries" ver. 0.1.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.8" instead of "5.7")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("nft-galleries.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin31,878 lines of code in 787 files:
LanguageFilesBlank linesComment linesLines of code
PHP3233,5048,34914,088
TypeScript3902,2271,05013,911
JSON23002,039
Sass16233161,039
XML380434
CSS11184173
YAML6390149
JavaScript143426
Markdown12019

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity4.69
▷ Minimum class complexity1.00
▷ Maximum class complexity76.00
Average method complexity2.17
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces70
Interfaces93
Traits6
Classes215
▷ Abstract classes62.79%
▷ Concrete classes20997.21%
▷ Final classes2110.05%
Methods1,151
▷ Static methods17815.46%
▷ Public methods1,00287.05%
▷ Protected methods1079.30%
▷ Private methods423.65%
Functions138
▷ Named functions53.62%
▷ Anonymous functions13396.38%
Constants140
▷ Global constants107.14%
▷ Class constants13092.86%
▷ Public constants11185.38%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
ui/images/icon-256x256.png35.18KB10.49KB▼ 70.18%
ui/images/icon-128x128.png15.35KB5.36KB▼ 65.06%