83% creative-commons

Code Review | Creative Commons

WordPress plugin Creative Commons scored83%from 54 tests.

About plugin

  • Plugin page: creative-commons
  • Plugin version: 2022.09.1
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-6.0.1
  • WordPress version: 6.3.1
  • First release: Sep 3, 2019
  • Latest release: Sep 9, 2022
  • Number of updates: 29
  • Update frequency: every 38.3 days
  • Top authors: cctimidrobot (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /14,015 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.02MB] [CPU: ▼13.07ms] Passed 4 tests

This is a short check of server-side resources used by Creative Commons
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2644.13 ▼1.53
Dashboard /wp-admin3.56 ▲0.2252.23 ▼16.75
Posts /wp-admin/edit.php3.68 ▲0.3251.91 ▲3.01
Add New Post /wp-admin/post-new.php5.08 ▼0.8157.69 ▼32.10
Media Library /wp-admin/upload.php3.49 ▲0.2636.66 ▼1.91
Creative Commons /wp-admin/options-general.php?page=cc-admin3.4535.57

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 74 new files
Database: no new tables, 7 new options
New WordPress options
widget_cc-license-widget
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Creative Commons
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲5514.25 ▼0.111.83 ▼0.0040.16 ▼4.62
Dashboard /wp-admin2,204 ▲275.61 ▲0.0089.79 ▼2.7439.21 ▼1.42
Posts /wp-admin/edit.php2,117 ▲142.06 ▲0.0842.52 ▲7.4236.20 ▲0.46
Add New Post /wp-admin/post-new.php6,206 ▲4,67819.13 ▼3.91924.52 ▲226.1756.23 ▼23.55
Media Library /wp-admin/upload.php1,411 ▲84.28 ▲0.09100.80 ▲0.3045.71 ▼0.90
Creative Commons /wp-admin/options-general.php?page=cc-admin1,1681.7126.5736.41

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
The following items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_cc-license-widget
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/creative-commons/widgets/creativecommons-widget.php:16

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 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
Attributes that require attention:
  • Screenshots: Please describe screenshot #6 in creative-commons/assets to your readme.txt
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
Please take inspiration from this readme.txt

creative-commons/creativecommons.php 85% from 13 tests

Analyzing the main PHP file in "Creative Commons" version 2022.09.1
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("creative-commons.php" instead of "creativecommons.php")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected4,693 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
CSS566651,384
PHP52476181,361
JavaScript1059246877
SVG8117491
PO File389108237
Sass15171167
Markdown2710143
YAML10133

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity51.00
▷ Minimum class complexity8.00
▷ Maximum class complexity97.00
Average method complexity3.21
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods69
▷ Static methods22.90%
▷ Public methods6188.41%
▷ Protected methods00.00%
▷ Private methods811.59%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants3
▷ Global constants266.67%
▷ Class constants133.33%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
11 PNG files occupy 0.38MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png13.71KB5.96KB▼ 56.53%
includes/images/by.png1.43KB1.21KB▼ 15.87%
assets/banner-1544x500.png258.94KB112.40KB▼ 56.59%
assets/banner-772x250.png93.67KB36.24KB▼ 61.31%
includes/images/by-nc-nd.png1.73KB1.47KB▼ 15.34%