pluginkollektiv / statify

Statify – statistics plugin for WordPress
https://wordpress.org/plugins/statify/
GNU General Public License v3.0
76 stars 22 forks source link

migrate to PSR-4 namespace and use Composer in production #261

Open stklcode opened 1 year ago

stklcode commented 1 year ago

This PR is WORK IN PROGRESS and not yet ready to be merged.


This proposal does change the project structure and class names.

First we introduce a Pluginkollektiv\Statify\ namespace and move the classes into it stripping their prefixes, i.e. Statify_Frontend will become Pluginkollektiv\Statify\Frontend. Then we introduce a PSR-4 autoloader with Composer and replace our custom autoloading function.

ToDo:

chesio commented 1 year ago

A small suggestion: I would stick to Vendor\Product scheme for namespaces as this scheme is well-established in PHP world and use Pluginkollektiv as vendor name, so the new namespace would be Pluginkollektiv\Statify. This lessens the risk of namespace collision to practically zero as Pluginkollektiv is also well-established name in PHP world... :-)

stklcode commented 1 year ago

Good point.

sonarcloud[bot] commented 11 months ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 18 Code Smells

No Coverage information No Coverage information
1.7% 1.7% Duplication

florianbrinkmann commented 11 months ago

I would vote to go with the minimal approach from #260 for now