Closed nash-ye closed 10 years ago
Just off the top of my head, I think a class for Options and a class for Admin page would make sense (depends on #27). It would also be great if each minifier were implemented as a strategy, so that they could be easily swapped out (this relates to #7). So off the top of my head, we could have:
Dependency_Minification
Dependency_Minification_Options
(extends ArrayObject
)Dependency_Minification_Minifier
(abstract class, extended by each strategy)Dependency_Minification_Admin_Page
(handles Settings API, adding admin page, etc)@westonruter Nice suggestions, and make full-sense for a starting point... I will start coding today.
@westonruter Which you prefer for the classes names prefix? DepMin
or Dependency_Minification
?
I think the shorter one is better.
@nash-ye humm, I guess for the main plugin class it should remain Dependency_Minfication
, but then the other classes in the plugin can freely use the shorter DepMin
prefix. I can't wait until we can use PHP namespaces without worrying about compatibility!
Pull requests #27 and #37 should get merged before the major refactor work.
Finally I had finished my exams today, I will complete this PR very soon, Thank you for your patience, I really appreciate it :)
Eid Mubarak!
@nash-ye :+1: Happy Eid!
I still need to finish reviewing @shadyvb's work on #27 before a refactor should happen. I did leave some feedback for him.
Thanks @westonruter It was a nice happy day :) I give some notes to @shadyvb too.. I can't wait to finish this PR :100:
All set, i took care of all comments.
@shadyvb This has been open too long, Please tell me when you finish your PR.
The PR has been merged into develop. Now we're just looking at applying PHP_CodeSniffer fixes.
Thanks @westonruter , So can we do this PR in 1.0 realase?
Yes, sounds good.
This pull on prograss. The classes that I have done for now are
DepMin_Options
DepMin_Cache
DepMin_Cache_Interface
DepMin_Cache_In_WP_Options
DepMin_Settings_Page
The first commit will be ready in the next two days... stay tuned!
@nash-ye what is DepMin_Cache_In_WP_Options
for?
@westonruter I have split the cache process to some small classes (slimier to WP_Object_Cache) so we can implement other ways to cache the compressed scripts/styles easily.
For example, we will could implement other caching methods like, separate SQLlite DB, Files...etc You will understand it more when I will push the first commit.
The first stage completed, please tell me your opinion.
What I have done?
1 Re-build the plugin as instantiated classes:
Dependency_Minification
DepMin_Admin
DepMin_Options
DepMin_SrcInfo
DepMin_Handler
DepMin_Collation
DepMin_Minify
DepMin_Minifier
DepMin_Minifier_Default
DepMin_Cache
DepMin_Cache_Default
DepMin_Cache_Interface
2- Fix some performance bugs and re-write some codes to look better :)
@nash-ye could you please close this and open PR another to the develop
branch?
Since it is opened to the master
branch, the PR includes all pending commits from develop
not just the new ones you have done.
@nash-ye Also, you can see that the Travis build failed due to warnings and errors reported by PHP_CodeSniffer. See https://travis-ci.org/x-team/wp-dependency-minification/jobs/13916005#L133
@westonruter Ok :+1:
As discussed in the issue #31 , We want to re-organize the plugin to have more professional OOP style.
@westonruter said:
You can read the full-discussion in the issue #31
so.. as starting point we want to agree on the scheme pattern and the needed classes.
What is the classes names prefix shall we use?
DepMin_
orDependency_Minification_
? How many classes can you separate the plugin to, and what they are? (write a names) ...etc