78% artistic-portfolio

Code Review | Artistic Portfolio

WordPress plugin Artistic Portfolio scored78%from 54 tests.

About plugin

  • Plugin page: artistic-portfolio
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.3-4.7.3
  • WordPress version: 6.3.1
  • First release: Apr 9, 2017
  • Latest release: Apr 9, 2017
  • Number of updates: 7
  • Update frequency: N/A
  • Top authors: shalaeva (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /573 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.60MB] [CPU: ▼21.63ms] Passed 4 tests

An overview of server-side resources used by Artistic Portfolio
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0940.71 ▼4.97
Dashboard /wp-admin3.39 ▲0.0849.97 ▼15.97
Posts /wp-admin/edit.php3.44 ▲0.0850.94 ▲1.96
Add New Post /wp-admin/post-new.php3.23 ▼2.6538.69 ▼66.06
Media Library /wp-admin/upload.php3.31 ▲0.0839.05 ▲0.47
Portfolio categories /wp-admin/edit-tags.php?taxonomy=portfolio_category&post_type=portfolio_item3.3037.47
Add item /wp-admin/post-new.php?post_type=portfolio_item3.2235.69
Portfolio items /wp-admin/edit.php?post_type=portfolio_item3.3539.63
Portfolio tags /wp-admin/edit-tags.php?taxonomy=portfolio_tag&post_type=portfolio_item3.3035.30

Server storage [IO: ▲0.18MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Just a few items left to fix
  • There were 1 file (1.99KB) illegally modified outside of "wp-content/plugins/artistic-portfolio/" and "wp-content/uploads/"
    • (new file) wp-content/themes/twentytwentyone/portfolio.php
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Artistic Portfolio: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲9214.47 ▼0.151.64 ▼0.1541.58 ▲0.99
Dashboard /wp-admin2,241 ▲505.88 ▲0.06104.10 ▲1.6643.96 ▼0.47
Posts /wp-admin/edit.php2,124 ▲382.02 ▼0.0038.60 ▲3.4233.02 ▼2.29
Add New Post /wp-admin/post-new.php1,562 ▲4323.10 ▼0.01692.14 ▲16.7152.60 ▼2.73
Media Library /wp-admin/upload.php1,423 ▲354.29 ▲0.0495.42 ▼17.7942.17 ▼5.68
Portfolio categories /wp-admin/edit-tags.php?taxonomy=portfolio_category&post_type=portfolio_item1,2972.1329.1028.26
Add item /wp-admin/post-new.php?post_type=portfolio_item2,8408.01190.3879.35
Portfolio items /wp-admin/edit.php?post_type=portfolio_item1,1391.9733.7230.91
Portfolio tags /wp-admin/edit-tags.php?taxonomy=portfolio_tag&post_type=portfolio_item1,2662.1427.0527.38

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/post-new.php?post_type=portfolio_item
    • > Notice in wp-content/plugins/artistic-portfolio/artistic-portfolio.php+123
    Object of class stdClass could not be converted to int
    • > GET request to /wp-admin/post-new.php?post_type=portfolio_item
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=portfolio_item
    • > Notice in wp-content/plugins/artistic-portfolio/artistic-portfolio.php+232
    Undefined index: ap_custom_attachment_nonce

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/artistic-portfolio/artistic-portfolio.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Donate link: Invalid url: "paypal.me/shalaeva"
The official readme.txt is a good inspiration

artistic-portfolio/artistic-portfolio.php Passed 13 tests

The primary PHP file in "Artistic Portfolio" version 1.0 is used by WordPress to initiate all plugin functionality
46 characters long description:
Create you own portfolio with multiple images!

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
Good job! No executable or dangerous file extensions detected351 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP11145224
PO File14244127

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.14MB with 0.10MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
artistic-portfolio.png142.07KB38.80KB▼ 72.69%