77% wp-cards

Code Review | WP Cards

WordPress plugin WP Cards scored77%from 54 tests.

About plugin

  • Plugin page: wp-cards
  • Plugin version: 1.5.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.2.3
  • WordPress version: 6.3.1
  • First release: Aug 26, 2014
  • Latest release: Jul 27, 2015
  • Number of updates: 29
  • Update frequency: every 11.6 days
  • Top authors: rocketwood (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

70+ active /4,768 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.68MB] [CPU: ▲4.26ms] Passed 4 tests

A check of server-side resources used by WP Cards
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.15 ▲0.6951.52 ▲8.90
Dashboard /wp-admin4.03 ▲0.7255.75 ▲0.51
Posts /wp-admin/edit.php4.08 ▲0.7357.98 ▲6.60
Add New Post /wp-admin/post-new.php6.54 ▲0.66100.46 ▲1.03
Media Library /wp-admin/upload.php3.89 ▲0.6644.44 ▲8.92
WP-Cards /wp-admin/options-general.php?page=wp_cards_options3.7230.32

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 53 new files
Database: no new tables, 17 new options
New WordPress options
widget_wp_cards_featurette_by_category_widget
widget_recent-posts
widget_wp_cards_builder_widget
widget_wp_cards_jumbotron_register_widget
widget_wp_cards_jumbotron_banner_widget
widget_recent-comments
widget_wp_cards_category_carousel_widget
widget_wp_cards_spotlight_widget
theysaidso_admin_options
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Cards
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.72 ▲0.721.76 ▼0.1242.01 ▼1.98
Dashboard /wp-admin2,196 ▲195.59 ▲0.0291.53 ▼1.2143.47 ▲0.36
Posts /wp-admin/edit.php2,107 ▲71.96 ▼0.0739.24 ▲4.0735.36 ▼3.57
Add New Post /wp-admin/post-new.php1,529 ▲323.20 ▼0.50602.38 ▼64.4751.04 ▼4.71
Media Library /wp-admin/upload.php1,404 ▲44.22 ▲0.13100.39 ▼13.5543.87 ▼5.09
WP-Cards /wp-admin/options-general.php?page=wp_cards_options9232.0224.5732.32

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 17 options in the database
    • widget_wp_cards_multi_view_widget
    • widget_wp_cards_jumbotron_register_widget
    • widget_wp_cards_dynamic_slide_carousel_widget
    • widget_wp_cards_jumbotron_banner_widget
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_wp_cards_featurette_by_category_widget
    • db_upgraded
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp_cards_options
    • > Notice in wp-content/plugins/wp-cards/wp-cards-plugin-options.php+86
    Undefined index: action

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
Please fix the following items
  • 36× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-cards/cards/card-jumbotron-register.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function have_posts() in wp-content/plugins/wp-cards/templates/loop-featurette.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function have_posts() in wp-content/plugins/wp-cards/templates/loop-list.php:3
    • > PHP Warning
      extract() expects parameter 1 to be array, null given in wp-content/plugins/wp-cards/sample-files/home.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-cards/cards/card-dynamic-slide-carousel.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function have_posts() in wp-content/plugins/wp-cards/templates/loop-tile.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_cards_get_view() in wp-content/plugins/wp-cards/templates/loop.php:2
    • > PHP Warning
      extract() expects parameter 1 to be array, null given in wp-content/plugins/wp-cards/wp-cards-template.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function have_posts() in wp-content/plugins/wp-cards/templates/loop-grid.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_ID() in wp-content/plugins/wp-cards/templates/excerpt-featurette.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === wp-cards === )
  • Screenshots: Please add images for these screenshots: #1 (Example of a “Registration” Jumbotron card), #2 (Example of a “Search” Jumbotron card), #3 (Example of a “Banner” Jumbotron card), #4 (Example of a “Carousel” card), #5 (Example of a “Spotlight” card), #6 (Example of a “Category Carousel” card), #7 (Example of a “Featurette by Category” card), #8 (Example of a “Latest Post Grid” card)
The official readme.txt might help

wp-cards/wp-cards.php 92% from 13 tests

The entry point to "WP Cards" version 1.5.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin4,209 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
PHP354631983,286
CSS27790921
JavaScript1002

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.21
Average class complexity20.08
▷ Minimum class complexity3.00
▷ Maximum class complexity81.00
Average method complexity5.67
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods49
▷ Static methods12.04%
▷ Public methods4795.92%
▷ Protected methods00.00%
▷ Private methods24.08%
Functions26
▷ Named functions26100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
9 PNG files occupy 2.61MB with 1.54MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png273.24KB104.20KB▼ 61.87%
screenshot-7.png328.93KB124.60KB▼ 62.12%
screenshot-8.png53.82KB21.09KB▼ 60.82%
screenshot-6.png334.76KB113.79KB▼ 66.01%
screenshot-4.png499.22KB276.31KB▼ 44.65%