johnbintz / comicpress-2.8 Goto Github PK
View Code? Open in Web Editor NEWComicPress 2.8
Home Page: http://comicpress.org/
ComicPress 2.8
Home Page: http://comicpress.org/
Each widget should have unit tests set up for it to ensure it works as expected. See test/widgets/GraphicalNavigationTest.php for an example.
When a thumbnail is requested - properly find the right one, do it with a function and set the correct order to degrade down to if the one requested doesn't exist, degrade to the next, etc.
Right now it's using a set of code that is common to all of them but not set as a function.
default = always go back one chapter
alternate = go back to beginning of chapter if not at start of current chapter, otherwise, default behavior
Functionally, they're the same except for a few label and SQL query changes. Make them use the same backend function and have the short code calls be wrappers around this backend function.
All of the legacy template tags for traversing posts should have their innards replaced with calls to the appropriate ComicPress Core classes.
Make an argument for childthemes to pass to the comicpress options for what layouts are possible.
i.e. childfunctions.php set's it, comicpress-options.php reads it if (empty()) use default
There's a lot of code duplicated throughout the current version of the theme. Use the PMD Copy Paste Detector to find this code and refactor it, if it makes sense to factor the code:
display_comic() should exclusively use filters to determine how to display incoming file types, and allow for extension based on said filters, rather than hardcoding the behaviors for specific formats within the function itself.
Metadata for media files (width, height, etc.) can be handled one of three ways. None of these are mutually exclusive, and some are already implemented.
Warning: call_user_func_array(): First argumented is expected to be a valid callback, 'comicpresstranscriptwidget::wp_head' was given in /home/content/t/r/i/triefy/html/test/wp-includes/plugin.php on line 339
Warning: call_user_func_array() [function.call-user-func-array]: First argumented is expected to be a valid callback, 'comicpresstranscriptwidget::wp_head' was given in **/wp-includes/plugin.php on line 339
Is this a php4 thing?
It's a mess. Rewrite it and set up testing.
The register_sidebar() statements are all copy-pasted. Instead, loop through a well-structured array and have only one register_sidebar() call that takes the array members as input.
At some point we lost the functionality of the Calendar Directory.
Setting ComicPress Options / Posts & Pages / Calendar / Calendar Directory to "default" does not place the calendar images on archive-comic-calendar.php
Urls are generated (as per my copy of wp 2.9.1) using author_nicename (or user_nicename) but it is trying to be looked up by login name.
Easy fix:
$curauth = get_user_by('slug', get_query_var('author_name'));
I'm thinking I want to revamp code that is used in multiple places as a function that echos an output out and add a filter to each individual position, thoughts?
For example, the Comments link is used in the comicblogpost blogpost and can have a partial as well as it's used in the comments widget, if I set that as a function we can call it from all three and put a filter on it and reduce code usage, could pretty much do that for almost everything.
Would it be better to have a function call or have it straight parse, as in the way of memory and system usage?
With storyline deactivated the graphical navigation will only read the single primary comic category, however if someone creates sub categories to that primary the navigation will not know how to deal with those because of the method it uses to handle walking with the 0/category
If someone removes the comicpress storyline from being used it also gets confused at that point as well.
It's supposed to take you back to the beginning of the chapter if your not
at the beginning of the chapter. If it does not, like I said it's a bug.
Right, well do we need an alternate behavior, can't that be the
default and only behavior to avoid confustion? One more click and they
are back to chapter 2 but I don't see any reason to skip the chapter 3
start page ever if you are in chapter 3.
Sure, i'm cool with that. All John has to do is remove that option and make it the only behavior
Starshipmoonhawk was trying out 2.9 on godaddy's hosting and it coudlnt find the proper file to display with the media handler, so I cut and pasted the old code back in and still coldnt find it, then I changed CPM_DATE_FORMAT to 'Y-m-d' and it then found them no problem.
I figure the media handling.inc is having an issue with the regexp on his site like it was with mine and temporarily got him working by putting the old code back in.
using maybe?
if (function_exists('cpm_wpmu_modify_path')) {
}
modify the document root path to handle locating the files in WPMU
adding the mu-plugins php file to the repository under the wpmu directory, which should also be removed from the compiling of the zip file
functions.php is not recognizing the comic category as a comic category on a fresh install even though the comic category is set as comic the comic category the get_all_comic_categories_as_cat_string() is not sending the cats as per set unless storyline in comicpress manager is enabled.
So i'm thinking setting it up on init to find the option isn't enough, but whenever we change the category in comicpress options that it redo this routine:
$storyline = get_option('comicpress-storyline-category-order'); $do_rebuild = false; if (empty($storyline)) { $do_rebuild = true; } else { $first = array_pop(explode('/', array_shift(explode(',', $storyline)))); if ($first != $comicpress_options['comicpress_config']['comiccat']) { $do_rebuild = true; } }
so that it's rebuilt when category changes.
The bookmark seems to have broken. Only works in Firefox (not Safari, Chrome or IE). They only show the TAG PAGE button and it does nothing. Haven't had a chance to look at it myself yet.
display_comic() as it is now is too hard-coded. It should be using filters to handle the heavy lifting of alternate display methods:
echo apply_filters('comicpress_display_comic','', $comicpress_options);
With the lower-down filters skipping their processing if the incoming $content (the first parameter) is not empty().
filter(3): string(58) "C:\inetpub\comicpress.frumph.net/comics/2009-11-24..."
DIRNAME:string(52) "C:\inetpub\comicpress.frumph.net/comics/2009-11-24.*"
Currently every ComicPress option lives in its own WP options key/value pair. Switch this over to having a single array that contains all the keys. I would suggest wrapping this in either a singleton class or static methods on a class to handle loading/saving options.
Right now, all options forms have the ID of "myForm" and the name of "template". This is invalid HTML. Give all of the forms unique IDs and names.
Eliminate the concat chaining and use sprintf() to build the copyright string in cp_copyright.
It appears that the hidemessage() function is not defined unless the "ComicPress Options SAVED" message appears.
Currently every widget but graphical navigation initializes itself in its own widget file. I want to see these initialization routines removed from the widget files themselves, the files renamed so that they match the class name of the widget:
widgets/ComicPressBuyPrintWidget.inc
class ComicPressBuyPrintWidget extends WP_Widget {}
and instead use a loader like this in the comicpress init hook:
add_action('widgets_init', '__comicpress_widgets_init');
function __comicpress_widgets_init() {
foreach (glob('widgets/*') as $widget_file) {
require_once($widget_file);
$class_name = basename($widget_file);
$widget = new $class_name(); // is this line necessary?
register_widget($class_name);
}
}
In functions.php should the extensions on the filenames here be .inc rather than .php to coincide with existing ComicPress file naming?
function comicpress_check_child_file($filename = '') {
if (empty($filename)) return false;
if (get_stylesheet_directory() != get_template_directory()) {
if (file_exists(get_stylesheet_directory() .'/'. $filename . '.php')) {
return include(get_stylesheet_directory() .'/'. $filename . '.php');
}
}
return false;
}
Before I make a fool out of myself again on the regular wordpress site I need to check whether or not its something your doing thats creating this problem.
inside the comicblogpost widget if I put is_archive() as a return result if its on an is_archive() page it considers that to be true
As you can see with the following I reduced the amount of queries (used to be 134 +) by adjusting how I use the in_comic_category() now, the high roller is the navigation widget with 25-28 queries by itself.
Can we clean that up some at all? Or is that how it's going to be?
Everything Turned off = 10 queries
Add Default Menubar with no options turned on, = 14 queries (+4)
Default Menubar with all options except navigation since navigation isn't available) = 16 queries (+2)
DefaultMenubar with all options turned on including navigation and add the display of the comic = 22 queries (+8)
Default Menubar (all options + comic disp + comic post) = 26 queries (+4)
Default Menubar (all options + comic disp + comic post + sidebars(l/r)) = 35 queries (+9) for sidebars-both
(menubar all options + comic disp + comic post + sidebars(l/r) + default navigation above comic post) = 41 queries (+6) for default nav
(menubar all options + comic disp + comic post + sidebars(l/r) + default navigation above comic post + footer text) = 42 queries (+1) for footer text
everything above add blog posts (5) 60-62 queries (+22-24 for 5 posts)
Everything above + comic navigation in under-comic 88 queries (+26-28 for a single instance of comic navigation)
Shouldn't test code of John's be the same way the comicpress-config.php is behaving where it's only on john's system and not in the distro? Would like to see it removed since neither tyler dan or myself actually need it and the end user as well.
Only add the filter for comicpress_the_title_rss (found in functions/syndication.php) if the option is enabled.
These two widgets are identical except for one label and one SQL query. Make them the same and allow the user to choose the type of post to query in the widget options.
Any code that is database-intensive should be using WP Cache functions to store outputs for later use. Keep in mind that other functions that these functions are calling may be caching their own data outputs, so don't overdo the caching.
in_comic_category() is such a candidate for the setting up of WP Caching.
There is a large amount of duplicated code in here. Refactor these:
$comicpress_options['disable_page_restraints'] = (bool)( $_REQUEST['disable_page_restraints'] == 1 ? true : false );
$comicpress_options['rascal_says'] = (bool)($_REQUEST['rascal_says'] == 1 ? true : false );
to work like this, where possible:
foreach (array('disable_page_restraints', 'rascal_says') as $key) { $comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false ); }
and the includes to load like this:
foreach (glob(get_template_directory() . '/options/*.php') as $file) { include($file); }
Some functions are prefixed with cp_ and some with comicpress_, and some not at all. Pick one prefix and name all the others to that one. I suggest comicpress_.
Right now there's way too much copying and pasting of structure within the options pages, and there's an unnecessary use of a large switch. This makes adding new options and restructuring existing options very prone to errors. They should be reworked so that an array of data drives the HTML generation as much as possible:
foreach(array(
array(
'title' => __('My ComicPress option', 'comicpress'),
'field' => 'my-option',
'type' => 'checkbox',
'description' => __('Enabling this option does cool stuff.', 'comicpress')
)
) as $info) {
extract($info); ?>
<tr>
<th scope="row"><?php echo esc_html($title}; ?></th>
<td>
<?php
switch ($type) {
class 'checkbox': ...code to print a checkbox for the current $field
}
?>
<p><em><?php echo esc_html($description) ?></em></p>
</td>
</tr>
<?php
}
When archive and search functions utilize the showing of images as thumbnails none show up for media file comics like swf etc so we need to create a generic thumbnail image that can be placed in the core template to read from and overridden by one in the child theme.
(reminder to myself or whoever else wants to work on it)
We should think about moving away from using comicpress-config.php and instead move to storing this data within WP Options, similar to what will be done with Core. This will make the build and upgrade process a lot more smooth, and then we can remove this functionality from ComicPress Manager, simplifying it as well.
Non-storyline, non-embedding functions will probably be used on future themes, for example cp_copyright
. Set up unit tests for these functions to ensure they work correctly.
wp_get_post_categories($post->ID) in in_comic_category() is adding a large amount of SQL queries to the page, is there a way we can do this in_comic_category() without so many sql queries for it?
Securely work with $post and $wp_query in ComicPressLatestComicsWidget.
BookmarkWidget and ArchiveDropdownWidget cannot be called from the_widget()
When consolidating everything the query count pretty much nearly trippled for some reason.
Wordpress does not allow .inc files to be seen, and often lately i've had to lose jobs based on unable to edit the code to make it work appropriately.
For diagnosing and repairing so it can be online when no ftp access is available the files need to be renamed to .php instead of .inc.
I've read some stuff someplace, no idea how it works for the is_active_widget, could we use that in the bookmark widget to determine whether or not to push the stuff to the head and wp_enqueue?
The code that prepares the widget nav should be broken out and have unit tests set up for it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.