Code Monkey home page Code Monkey logo

comicpress-2.8's People

Contributors

johnbintz avatar mindfaucet avatar oycomics avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

therob3000

comicpress-2.8's Issues

Set up widget unit tests

Each widget should have unit tests set up for it to ensure it works as expected. See test/widgets/GraphicalNavigationTest.php for an example.

Move to using filters for incoming file types

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.

  • Include parsers for filetypes. This potentially adds additional dependencies on the codebase depending on filetype.
  • Pull the metadata from filenames (ex: my-movie-320x240.flv).
  • Pull metadata from post information. This will need to be smart enough to match metadata to the correct file, and flexible & accessible enough so that similar components can be used for different media types (ex: flv and swf both need size information, but swf can also accept additional information such as background color, opacity, etc.)

Make sidebar registration data-driven

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.

Calendar Directory

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

comicpress/themes.php uses login name not slug

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'));

Re-vamping commonly used segments of code.

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?

ComicPress Navigation (new) problem with categories and navigation non-storyline

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.

Make "Alternate Behavior" the default behavior of Previous Chapter in Graphical Navigation

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

ComicPressMediaHandling.inc problem.

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.

Adjust ComicPressMediaHandling to handle WPMU files path

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

comic categories on fresh install are not being recognized if changed

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.

Bookmark

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() should use filters to handle special options

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().

Fix dirname() issues on windows

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.*"

Merge options into single serialized array

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.

Create widget loading infrastructure and remove widget initialization fron widget files

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);
  }
}

Child theme partials... comicpress_check_child_file()

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;
}

is_home() in layout-head.php is setting is_archive to be true

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

New ComicPressNavigationWidget SQL queries cleanup

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)

Test Code

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.

Ensure use of WP Cache functions in database-intensive code

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.

Refactor comicpress-options.php

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);
}

Rework postoptions.php and similar options pages to be data-driven

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
}

Move comicpress-config.php needs to WP Option

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.

rss_count_comments() cleanup

  • Remove global variable references
  • Use ngettext() for pluralization handling
  • Use a function parameter instead of func_get_args()

Rename .inc files as .php so they can be edited online.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.