Plugin Directory

Changeset 3243224


Ignore:
Timestamp:
02/19/2025 12:23:13 PM (12 months ago)
Author:
realwebcare
Message:

Committing Muslim Prayer Time BD v3.0.1 to fix an issue

Location:
muslim-prayer-time-bd/trunk
Files:
2 added
19 edited

Legend:

Unmodified
Added
Removed
  • muslim-prayer-time-bd/trunk/actions/mptbd-functions.php

    r3242321 r3243224  
    88 * The class supports both Bengali and English outputs for better localization.
    99 *
    10  * @package Muslim Prayer Time BD - v3.0 - 18 February, 2025
     10 * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
    1111 * @link https://www.realwebcare.com/
    1212 */
     
    308308         */
    309309        public function mptbd_prayer_district_time( $prayer_name, $mod_time = '', $type = '' ) {
    310             // Parse base time
    311             $base_time = strtotime($prayer_name);
    312             if ( !$base_time ) {
     310            // Set the Bangladesh timezone
     311            $bangladesh_timezone = new DateTimeZone('Asia/Dhaka');
     312       
     313            // Create a DateTime object for the prayer time in Bangladesh timezone
     314            $base_time = DateTime::createFromFormat('H:i', $prayer_name, $bangladesh_timezone);
     315       
     316            if ( ! $base_time ) {
    313317                return "Invalid Time";
    314318            }
    315    
    316             // Apply modification
    317             if (!empty($mod_time)) {
    318                 $base_time = strtotime($mod_time, $base_time);
    319                 if (!$base_time) {
    320                     return "Invalid Modified Time"; // Handle invalid modification
    321                 }
    322             }
    323 
     319       
     320            // Apply modification if provided
     321            if ( ! empty( $mod_time ) ) {
     322                $mod_interval = DateInterval::createFromDateString($mod_time);
     323                if ( ! $mod_interval ) {
     324                    return "Invalid Modified Time";
     325                }
     326                $base_time->add($mod_interval);
     327            }
     328       
    324329            // Determine adjustment based on type
    325330            $adjust_key = $type === 'sehri' ? 'adj_sehri_time' : 'adj_prayer_time';
     
    327332            $options = get_option( $section );
    328333            $adjust = isset( $options[$adjust_key] ) ? absint( $options[$adjust_key] ) . ' minutes' : '0 minutes';
    329 
     334       
    330335            // Apply adjustment
    331             $final_time = strtotime($adjust, $base_time);
    332             if (!$final_time) {
     336            $adjust_interval = DateInterval::createFromDateString($adjust);
     337            if ( ! $adjust_interval ) {
    333338                return "Invalid Adjusted Time";
    334339            }
    335    
    336             // Format time
    337             $time_format_string = $this->time_format == '12' ? ($this->ampm_option ? "g:i A" : "g:i") : ($this->ampm_option ? "G:i A" : "G:i");
    338             $formatted_time = gmdate($time_format_string, $final_time + (get_option('gmt_offset') * HOUR_IN_SECONDS));
    339 
     340            $base_time->add($adjust_interval);
     341       
     342            // Format the time using WordPress's timezone functions
     343            $formatted_time = wp_date(
     344                $this->time_format == '12' ? ($this->ampm_option ? "g:i A" : "g:i") : ($this->ampm_option ? "G:i A" : "G:i"),
     345                $base_time->getTimestamp(),
     346                $bangladesh_timezone
     347            );
     348       
    340349            // Convert to Bangla if necessary
    341             if ($this->prayer_ln == 'bn_BD') {
     350            if ( $this->prayer_ln == 'bn_BD' ) {
    342351                $formatted_time = $this->mptbd_prayer_time_eng_to_bang( $formatted_time );
    343352            }
    344    
     353       
    345354            return $formatted_time;
    346         }
    347 
    348         /**
    349          * Calculates the default prayer time for a given prayer name and applies any modifications.
    350          *
    351          * This function retrieves the default prayer time based on the prayer name (e.g., fajr, duhr), applies any
    352          * modification if provided, and formats the time according to user preferences. The time is optionally
    353          * converted to Bangla if the prayer language setting is enabled.
    354          *
    355          * @param string $prayer_name The name of the prayer (e.g., 'fajr', 'duhr').
    356          * @param string $mod_time Optional modification to be added to the base time.
    357          *
    358          * @return string The formatted prayer time, or an error message if the time is invalid.
    359          */
    360         public function mptbd_prayer_default_time( $prayer_name, $mod_time = '' ) {
    361             // Parse base time
    362             $base_time = strtotime($prayer_name);
    363             if ( !$base_time ) {
    364                 return "Invalid Time"; // Handle invalid input gracefully
    365             }
    366        
    367             // Apply modification if provided
    368             if (!empty($mod_time)) {
    369                 $base_time = strtotime($mod_time, $base_time);
    370                 if (!$base_time) {
    371                     return "Invalid Modified Time"; // Handle invalid modification
    372                 }
    373             }
    374        
    375             // Determine the format string
    376             $time_format_string = $this->time_format == '12'
    377                 ? ($this->ampm_option ? "g:i A" : "g:i")
    378                 : ($this->ampm_option ? "G:i A" : "G:i");
    379        
    380             // Format the time
    381             $prayer_time = gmdate($time_format_string, $base_time + (get_option('gmt_offset') * HOUR_IN_SECONDS));
    382        
    383             // Convert to Bangla if necessary
    384             if ($this->prayer_ln == 'bn_BD') {
    385                 $prayer_time = $this->mptbd_prayer_time_eng_to_bang($prayer_time);
    386             }
    387        
    388             return $prayer_time;
    389355        }
    390356    }
  • muslim-prayer-time-bd/trunk/actions/mptbd-shortcode.php

    r3242321 r3243224  
    88 * and dynamic adjustments to prayer times based on user-selected settings.
    99 *
    10  * @package Muslim Prayer Time BD - v3.0 - 18 February, 2025
     10 * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
    1111 * @link https://www.realwebcare.com/
    1212 */
     
    218218                        <form id="city_time" action="" method="post" name="city_time">
    219219                            <select id="cityname" name="cityname" onChange="prayerOnChange('<?php echo esc_attr( $prayer_id ); ?>', '<?php echo esc_attr( $prayer_time ); ?>', '<?php echo esc_attr( $ramadan_card ); ?>', this.options[this.selectedIndex].value);">
    220                                 <option value=""><?php echo esc_html( $city_name ); ?></option>
     220                                <option value="<?php echo esc_attr( $city_id ); ?>"><?php echo esc_html( $city_name ); ?></option>
    221221                                <?php foreach( $city_states as $key => $city ) { ?>
    222222                                    <option value="<?php echo esc_attr( $key ); ?>"<?php selected( $key, $city_id ); ?>><?php echo esc_html( $city ); ?></option>
  • muslim-prayer-time-bd/trunk/actions/mptbd-widget.php

    r3242325 r3243224  
    88 * updating widget settings.
    99 *
    10  * @package Muslim Prayer Time BD - v3.0 - 18 February, 2025
     10 * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
    1111 * @link https://www.realwebcare.com/
    1212 */
     
    2222        public function __construct() {
    2323            parent::__construct(
    24                 'mptb',
     24                'mptbd',
    2525                __('Muslim Prayer Time BD', 'muslim-prayer-time-bd'),
    2626                array(
     
    5454         * @return void Outputs the widget HTML.
    5555         */
    56         public function widget($args, $instance) {
    57             extract($args);
    58    
     56        public function widget( $args, $instance ) {
     57            // Use array keys directly instead of extract()
     58            $before_widget = isset( $args['before_widget'] ) ? $args['before_widget'] : '';
     59            $before_title = isset( $args['before_title'] ) ? $args['before_title'] : '';
     60            $after_title = isset( $args['after_title'] ) ? $args['after_title'] : '';
     61            $after_widget = isset( $args['after_widget'] ) ? $args['after_widget'] : '';
     62            $widget_id = isset( $args['widget_id'] ) ? $args['widget_id'] : '';
     63
    5964            // Use isset() or default values to prevent undefined array key warnings
    60             $title = isset($instance['title']) ? apply_filters('widget_title', $instance['title']) : '';
    61             $prayer_time = isset($instance['prayer_time']) ? $instance['prayer_time'] : 'off'; // Default to 'off' if not set
    62             $sehri_card = isset($instance['sehri_card']) ? $instance['sehri_card'] : 'off'; // Default to 'off' if not set
    63    
     65            $title = !empty( $instance['title'] ) ? apply_filters('widget_title', $instance['title']) : '';
     66            $prayer_time  = isset( $instance['prayer_time'] ) ? $instance['prayer_time'] : 'off';
     67            $sehri_card   = isset( $instance['sehri_card'] ) ? $instance['sehri_card'] : 'off';
     68            $default_city = !empty( $instance['default_city'] ) ? $instance['default_city'] : 'Dhaka';
     69            $mptbd_quotes = !empty( $instance['mptbd_quotes'] ) ? $instance['mptbd_quotes'] : 'off';
     70
     71            // Validation - Ensure only 'on' or 'off' values are allowed
     72            $valid_values = ['on', 'off'];
     73            $prayer_time = in_array( $prayer_time, $valid_values, true ) ? $prayer_time : 'off';
     74            $sehri_card = in_array( $sehri_card, $valid_values, true ) ? $sehri_card : 'off';
     75
    6476            echo wp_kses_post( $before_widget );
    6577
    66             if ($title) {
    67                 echo wp_kses_post( $before_title . $title . $after_title );
     78            if ( $title ) {
     79                echo wp_kses_post( $before_title ) . esc_html($title) . wp_kses_post( $after_title );
    6880            }
    6981
    70             // Check for 'on' values for prayer_time and sehri_card
    71             if ('on' == $prayer_time) :
    72                 if ('on' == $sehri_card) :
    73                     echo do_shortcode('[prayer_time pt="on" sc="on" id="' . $this->id . '"]');
    74                 else :
    75                     echo do_shortcode('[prayer_time pt="on" sc="off" id="' . $this->id . '"]');
    76                 endif;
    77             else :
    78                 if ('on' == $sehri_card) :
    79                     echo do_shortcode('[prayer_time pt="off" sc="on" id="' . $this->id . '"]');
    80                 else :
    81                     echo do_shortcode('[prayer_time pt="off" sc="off" id="' . $this->id . '"]');
    82                 endif;
    83             endif;
     82            echo do_shortcode('[prayer_time id="' . $widget_id . '" pt="' . esc_html( $prayer_time ) . '" sc="' . esc_html( $sehri_card ) . '" ct="' .  esc_html( $default_city ) . '" qt="' . wp_kses_post( $mptbd_quotes ) . '"]');
    8483
    8584            echo wp_kses_post( $after_widget );
     
    9897         * @return array The updated and sanitized widget settings.
    9998         */
    100         public function update($new_instance, $old_instance) {
     99        public function update( $new_instance, $old_instance ) {
    101100            $instance = $old_instance;
     101       
    102102            // Ensure default values if the fields are missing
    103             $instance['title'] = isset($new_instance['title']) ? wp_strip_all_tags($new_instance['title']) : '';
    104             $instance['prayer_time'] = isset($new_instance['prayer_time']) ? $new_instance['prayer_time'] : 'off'; // Default 'off'
    105             $instance['sehri_card'] = isset($new_instance['sehri_card']) ? $new_instance['sehri_card'] : 'off'; // Default 'off'
     103            $instance['title'] = !empty( $new_instance['title'] ) ? sanitize_text_field( $new_instance['title'] ) : '';
     104       
     105            // Validate checkbox values (should be 'on' or 'off' only)
     106            $valid_values = ['on', 'off'];
     107            $instance['prayer_time'] = isset( $new_instance['prayer_time'] ) && in_array( $new_instance['prayer_time'], $valid_values, true ) ? $new_instance['prayer_time'] : 'off';
     108            $instance['sehri_card'] = isset( $new_instance['sehri_card'] ) && in_array( $new_instance['sehri_card'], $valid_values, true ) ? $new_instance['sehri_card'] : 'off';
     109       
     110            // Ensure proper sanitization for city and quotes
     111            $instance['default_city'] = !empty( $new_instance['default_city'] ) ? sanitize_text_field( $new_instance['default_city'] ) : 'Dhaka';
     112            $instance['mptbd_quotes'] = !empty( $new_instance['mptbd_quotes'] ) ? sanitize_textarea_field( $new_instance['mptbd_quotes'] ) : 'off';
     113       
    106114            return $instance;
    107115        }
     
    121129            // Default values for form fields
    122130            $defaults = array(
    123                 'title' => __('Prayer Time Table', 'muslim-prayer-time-bd'),
    124                 'prayer_time' => 'on',
    125                 'sehri_card' => 'on'
     131                'title'         => __( 'Prayer Time Table', 'muslim-prayer-time-bd' ),
     132                'prayer_time'   => 'on',
     133                'sehri_card'    => 'off',
     134                'default_city'  => __( 'Dhaka', 'muslim-prayer-time-bd' ),
     135                'mptbd_quotes'  => __( 'off', 'muslim-prayer-time-bd' ),
    126136            );
    127             $instance = wp_parse_args((array) $instance, $defaults);
    128             $title = isset($instance['title']) ? esc_attr($instance['title']) : '';
     137
     138            $instance = wp_parse_args( (array) $instance, $defaults );
     139
     140            $title = !empty( $instance['title'] ) ? esc_attr($instance['title']) : '';
     141            $default_city = !empty( $instance['default_city'] ) ? esc_attr( $instance['default_city'] ) : 'Dhaka';
     142            $mptbd_quotes = !empty( $instance['mptbd_quotes'] ) ? esc_attr( $instance['mptbd_quotes'] ) : 'off';
     143
     144            // Validation - Ensure only 'on' or 'off' values are allowed
     145            $valid_values = ['on', 'off'];
     146            $prayer_time = in_array( $instance['prayer_time'], $valid_values, true ) ? $instance['prayer_time'] : 'off';
     147            $sehri_card = in_array( $instance['sehri_card'], $valid_values, true ) ? $instance['sehri_card'] : '';
    129148            ?>
    130    
     149
    131150            <p>
    132151                <label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php esc_html_e('Prayer Title:', 'muslim-prayer-time-bd'); ?></label>
     
    135154   
    136155            <p>
    137                 <input class="checkbox" type="checkbox" <?php checked($instance['prayer_time'], 'on'); ?> id="<?php echo esc_attr($this->get_field_id('prayer_time')); ?>" name="<?php echo esc_attr($this->get_field_name('prayer_time')); ?>" />
     156                <input class="checkbox" type="checkbox" <?php checked($prayer_time, 'on'); ?> id="<?php echo esc_attr($this->get_field_id('prayer_time')); ?>" name="<?php echo esc_attr($this->get_field_name('prayer_time')); ?>" />
    138157                <label for="<?php echo esc_attr($this->get_field_id('prayer_time')); ?>"><?php esc_html_e('Show Prayer Time', 'muslim-prayer-time-bd'); ?></label>
    139158            </p>
    140159   
    141160            <p>
    142                 <input class="checkbox" type="checkbox" <?php checked($instance['sehri_card'], 'on'); ?> id="<?php echo esc_attr($this->get_field_id('sehri_card')); ?>" name="<?php echo esc_attr($this->get_field_name('sehri_card')); ?>" />
     161                <input class="checkbox" type="checkbox" <?php checked($sehri_card, 'on'); ?> id="<?php echo esc_attr($this->get_field_id('sehri_card')); ?>" name="<?php echo esc_attr($this->get_field_name('sehri_card')); ?>" />
    143162                <label for="<?php echo esc_attr($this->get_field_id('sehri_card')); ?>"><?php esc_html_e('Show Sehri Card', 'muslim-prayer-time-bd'); ?></label>
     163            </p>
     164
     165            <p>
     166                <label for="<?php echo esc_attr($this->get_field_id('default_city')); ?>"><?php esc_html_e('Default City:', 'muslim-prayer-time-bd'); ?></label>
     167                <input class="widefat" type="text" id="<?php echo esc_attr($this->get_field_id('default_city')); ?>" name="<?php echo esc_attr($this->get_field_name('default_city')); ?>" value="<?php echo esc_attr($default_city); ?>" />
     168            </p>
     169
     170            <p>
     171                <label for="<?php echo esc_attr($this->get_field_id('mptbd_quotes')); ?>"><?php esc_html_e('Quotes:', 'muslim-prayer-time-bd'); ?></label>
     172                <textarea class="widefat" id="<?php echo esc_attr($this->get_field_id('mptbd_quotes')); ?>" name="<?php echo esc_attr($this->get_field_name('mptbd_quotes')); ?>" rows="4"><?php echo esc_textarea($mptbd_quotes); ?></textarea>
    144173            </p>
    145174   
  • muslim-prayer-time-bd/trunk/assets/css/mptbd-admin.css

    r3242321 r3243224  
    11/*!
    2 * @package Muslim Prayer Time BD - v3.0 - 18 February, 2025
     2* @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
    33* @link https://www.realwebcare.com/
    44*/
  • muslim-prayer-time-bd/trunk/assets/css/mptbd-style.css

    r3242321 r3243224  
    11/*!
    2  * @package Muslim Prayer Time BD - v3.0 - 18 February, 2025
     2 * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
    33 * @link https://www.realwebcare.com/
    44 */
  • muslim-prayer-time-bd/trunk/assets/js/mptbd-admin.js

    r3242321 r3243224  
    11/*!
    2  * @package Muslim Prayer Time BD - v3.0 - 18 February, 2025
     2 * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
    33 * @link https://www.realwebcare.com/
    44 */
  • muslim-prayer-time-bd/trunk/assets/js/mptbd-script.js

    r3242321 r3243224  
    44 * This script provides interactive behavior for the frontend of the Muslim Prayer Time BD plugin.
    55 *
    6  * @package Muslim Prayer Time BD - v3.0 - 18 February, 2025
     6 * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
    77 * @link https://www.realwebcare.com/
    88 */
  • muslim-prayer-time-bd/trunk/inc/init-mptbd.php

    r3242321 r3243224  
    1010 * within the WordPress ecosystem and provides an optimal user experience.
    1111 *
    12  * @package Muslim Prayer Time BD - v3.0 - 18 February, 2025
     12 * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
    1313 * @link https://www.realwebcare.com/
    1414 */
  • muslim-prayer-time-bd/trunk/inc/mptbd-enqueue.php

    r3242321 r3243224  
    1111 * improving performance and maintaining a clean and optimized page.
    1212 *
    13  * @package Muslim Prayer Time BD - v3.0 - 18 February, 2025
     13 * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
    1414 * @link https://www.realwebcare.com/
    1515 */
  • muslim-prayer-time-bd/trunk/inc/mptbd-help.php

    r3242321 r3243224  
    99 * on how to use shortcodes, widget integration, and customizations with attributes for prayer time display.
    1010 *
    11  * @package Muslim Prayer Time BD - v3.0 - 18 February, 2025
     11 * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
    1212 * @link https://www.realwebcare.com/
    1313 */
  • muslim-prayer-time-bd/trunk/inc/mptbd-perpetual_calendar.php

    r3242321 r3243224  
    99 * regardless of the geographic location.
    1010 *
    11  * @package Muslim Prayer Time BD - v3.0 - 18 February, 2025
     11 * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
    1212 * @link https://www.realwebcare.com/
    1313 */
  • muslim-prayer-time-bd/trunk/inc/mptbd-sidebar.php

    r3242321 r3243224  
    1010 * and allows for custom CSS class inclusion for styling.
    1111 *
    12  * @package Muslim Prayer Time BD - v3.0 - 18 February, 2025
     12 * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
    1313 * @link https://www.realwebcare.com/
    1414 */
     
    7474                                <h4>Using Block Widget (Gutenberg Editor)</h4>
    7575                                <ul class="mptbdusage-list">
    76                                     <li>Log in to your WordPress account and go to the <b>Appearance >> Editor</b> (Full Site Editing) or edit a specific page/post using the Gutenberg editor.</li>
     76                                    <li>Navigate to the <b>Appearance >> Widgets</b> from WordPress dashboard menu.</li>
    7777                                    <li>In the editor, click the <b>+ (Add Block)</b> button and search for the <b>Muslim Prayer Time BD</b> block widget.</li>
    7878                                    <li>Once found, click on the block to add it to your desired widget area or page section.</li>
     
    125125                            <ul class="mptbdusage-list">
    126126                                <li>Muslim Prayer Time BD</li>
    127                                 <li>Version: 3.0</li>
     127                                <li>Version: 3.0.1</li>
    128128                                <li>Scripts: PHP + CSS + JS</li>
    129129                                <li>Requires: Wordpress 5.4+</li>
    130130                                <li>First release: 23 January, 2014</li>
    131                                 <li>Last Update: 18 February, 2025</li>
     131                                <li>Last Update: 19 February, 2025</li>
    132132                                <li>By: <a href="%1$s" target="_blank">Realwebcare</a></li>
    133133                                <li>Facebook Page: <a href="%2$s" target="_blank">Realwebcare</a></li>
  • muslim-prayer-time-bd/trunk/languages/muslim-prayer-time-bd.pot

    r3242321 r3243224  
    44"Project-Id-Version: Muslim Prayer Time BD - Prayer Reminder for Bangladesh\n"
    55"Report-Msgid-Bugs-To: \n"
    6 "POT-Creation-Date: 2025-02-18 02:54+0000\n"
     6"POT-Creation-Date: 2025-02-19 12:20+0000\n"
    77"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    88"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    5858"</h4>\n"
    5959"                                <ul class=\"mptbdusage-list\">\n"
    60 "                                    <li>Log in to your WordPress account and "
    61 "go to the <b>Appearance >> Editor</b> (Full Site Editing) or edit a specific "
    62 "page/post using the Gutenberg editor.</li>\n"
     60"                                    <li>Navigate to the <b>Appearance >> "
     61"Widgets</b> from WordPress dashboard menu.</li>\n"
    6362"                                    <li>In the editor, click the <b>+ (Add "
    6463"Block)</b> button and search for the <b>Muslim Prayer Time BD</b> block "
     
    8584"                            <ul class=\"mptbdusage-list\">\n"
    8685"                                <li>Muslim Prayer Time BD</li>\n"
    87 "                                <li>Version: 3.0</li>\n"
     86"                                <li>Version: 3.0.1</li>\n"
    8887"                                <li>Scripts: PHP + CSS + JS</li>\n"
    8988"                                <li>Requires: Wordpress 5.4+</li>\n"
    9089"                                <li>First release: 23 January, 2014</li>\n"
    91 "                                <li>Last Update: 18 February, 2025</li>\n"
     90"                                <li>Last Update: 19 February, 2025</li>\n"
    9291"                                <li>By: <a href=\"%1$s\" target=\"_blank\">"
    9392"Realwebcare</a></li>\n"
     
    353352msgstr ""
    354353
     354#: actions/mptbd-widget.php:166
     355msgid "Default City:"
     356msgstr ""
     357
    355358#: settings/mptbd-settings.php:206
    356359msgid ""
     
    365368#: inc/mptbd-help.php:174
    366369msgid "Details Guide to Using the Shortcode"
     370msgstr ""
     371
     372#: actions/mptbd-widget.php:134
     373msgid "Dhaka"
    367374msgstr ""
    368375
     
    677684msgstr ""
    678685
     686#: actions/mptbd-widget.php:135
     687msgid "off"
     688msgstr ""
     689
    679690#. 1: Opening code tag, 2: Closing code tag
    680691#: inc/mptbd-help.php:232
     
    729740msgstr ""
    730741
    731 #: actions/mptbd-widget.php:123
     742#: actions/mptbd-widget.php:131
    732743msgid "Prayer Time Table"
    733744msgstr ""
     
    737748msgstr ""
    738749
    739 #: actions/mptbd-widget.php:132
     750#: actions/mptbd-widget.php:151
    740751msgid "Prayer Title:"
    741752msgstr ""
     
    743754#: settings/mptbd-class.settings-api.php:417
    744755msgid "Preview"
     756msgstr ""
     757
     758#: actions/mptbd-widget.php:171
     759msgid "Quotes:"
    745760msgstr ""
    746761
     
    863878msgstr ""
    864879
    865 #: actions/mptbd-widget.php:138
     880#: actions/mptbd-widget.php:157
    866881msgid "Show Prayer Time"
    867882msgstr ""
     
    871886msgstr ""
    872887
    873 #: actions/mptbd-widget.php:143
     888#: actions/mptbd-widget.php:162
    874889msgid "Show Sehri Card"
    875890msgstr ""
  • muslim-prayer-time-bd/trunk/muslim-prayer-time-bd.php

    r3242321 r3243224  
    44 * Plugin URI:        http://wordpress.org/plugins/muslim-prayer-time-bd/
    55 * Description:       Muslim Prayer Time BD plugin displays prayer (salah) times for Muslims in Bangladesh with a beautifully designed widget.
    6  * Version:           3.0
     6 * Version:           3.0.1
    77 * Requires at least: 5.2
    88 * Requires PHP:      7.4
  • muslim-prayer-time-bd/trunk/process/render-prayer-time.php

    r3242321 r3243224  
    1111 * taking into account any time modifications.
    1212 *
    13  * @package Muslim Prayer Time BD - v3.0 - 18 February, 2025
     13 * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
    1414 * @link https://www.realwebcare.com/
    1515 */
     
    9696
    9797            $time_schedule = $this->get_calender->mptbd_perpetual_calendar();
    98            
     98
    9999            $pr_names = $this->get_functions->mptbd_period_of_time();
     100
    100101            $adjust_time = $this->get_functions->mptbd_time_adjustment( $default_city ); ?>
    101102
     
    173174                            } else {
    174175                                foreach($period_times as $key => $period) {
    175                                     if($mptbd == $key + 1) { ?><li class="time_table"><?php if($period != '') { echo esc_html($period).' ' ; } echo esc_html( $this->get_functions->mptbd_prayer_default_time($time_schedule[$pr_names[$key]], $prayer_adjust) ); ?></li><?php }
     176                                    if($mptbd == $key + 1) { ?><li class="time_table"><?php if($period != '') { echo esc_html($period).' ' ; } echo esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule[$pr_names[$key]], $prayer_adjust) ); ?></li><?php }
    176177                                }
    177178                            }
     
    184185                            else {
    185186                                foreach($period_times as $key => $period) {
    186                                     if($mptbd == $key + 1) { ?><li class="time_table"><?php if($period != '') { echo esc_html($period).' ' ; } echo esc_html( $this->get_functions->mptbd_prayer_default_time($time_schedule[$pr_names[$key]], $prayer_adjust) ); ?></li><?php }
     187                                    if($mptbd == $key + 1) { ?><li class="time_table"><?php if($period != '') { echo esc_html($period).' ' ; } echo esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule[$pr_names[$key]], $prayer_adjust) ); ?></li><?php }
    187188                                }
    188189                            }
  • muslim-prayer-time-bd/trunk/process/render-sehri-card.php

    r3242321 r3243224  
    1010 * such as time adjustments for Sehri and Iftar.
    1111 *
    12  * @package Muslim Prayer Time BD - v3.0 - 18 February, 2025
     12 * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
    1313 * @link https://www.realwebcare.com/
    1414 */
     
    112112                        echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['sehri'], '+8 minutes', 'sehri') );
    113113                    } else {
    114                         echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_default_time($time_schedule['sehri'], $sehri_adjust) );
     114                        echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['sehri'], $sehri_adjust) );
    115115                    }
    116116                } else {
     
    118118                        echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['sehri'], $adjust_time, 'sehri') );
    119119                    } else {
    120                         echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_default_time($time_schedule['sehri'], $sehri_adjust) );
     120                        echo esc_html($sehri_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['sehri'], $sehri_adjust) );
    121121                    }
    122122                } ?>
     
    155155                        echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['maghrib'], '+8 minutes') );
    156156                    } else {
    157                         echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_default_time($time_schedule['maghrib'], $prayer_adjust) );
     157                        echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['maghrib'], $prayer_adjust) );
    158158                    }
    159159                } else {
     
    161161                        echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['maghrib'], $adjust_time) );
    162162                    } else {
    163                         echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_default_time($time_schedule['maghrib'], $prayer_adjust) );
     163                        echo esc_html($iftar_title) . ' ' .  esc_html( $this->get_functions->mptbd_prayer_district_time($time_schedule['maghrib'], $prayer_adjust) );
    164164                    }
    165165                } ?>
  • muslim-prayer-time-bd/trunk/readme.txt

    r3242337 r3243224  
    11=== Muslim Prayer Time BD – Prayer Reminder for Bangladesh ===
    22Contributors: realwebcare
    3 Tags: timetable, prayer schedule, time widget, reminder, time settings
     3Tags: salat, salat time, prayer time, namaz, Islam
    44Requires at least: 5.2
    55Tested up to: 6.7
     
    2121With Muslim Prayer Time BD, you can effortlessly display the daily prayer timetable for your location. The plugin is **built on the official perpetual prayer calendar for Bangladesh**, ensuring that the times are always accurate and relevant. During Ramadan, you can activate the option to show **Sehri** and **Iftar** timings, allowing your visitors to stay informed about important meal times during the fasting period.
    2222
    23 This plugin also provides the flexibility to display multiple widgets on your site. You can customize each widget to show only prayer times, only Sehri and Iftar times, or both. Simply enable or disable the options based on your preferences. For example, if you want to display just the Sehri and Iftar times, you can easily uncheck the **Show Prayer Time** option.
     23This plugin also allows you to display multiple widgets on your site, each with customizable settings. You can choose to display only `prayer times`, `Sehri` and `Iftar` times, or both. Additionally, you can adjust the **Default City** and display **Islamic Quotes** for each widget. Simply adjust these options according to your preference. For instance, if you only want to display `Sehri` and `Iftar` times, you can uncheck the **Show Prayer Time** option. The flexibility to customize each widget ensures a personalized experience for your site visitors.
    2424
    2525Additionally, the plugin allows you to personalize the display according to your style. You can modify the prayer names, choose between **12-hour or 24-hour time formats**, set custom names for the Sehri and Iftar cards, and adjust the widget's background color, font color, font weight, and text alignment to suit your site's theme.
     
    3535
    3636
    37 = Usage =
    38 * Install and activate the plugin. Go to your Dashboard, then navigate to **Appearance >> Widgets**. There you will find the **Muslim Prayer Time BD** widget. Just drag and drop the widget into your sidebar, enter a widget title, and save it. Visit your site, and you will see the Prayer Timetable in your sidebar.
    39 * Additionally, you can display the Prayer Timetable anywhere on your site using the shortcode `[prayer_time]`. You can customize the output with optional attributes such as `ct` (for default city) and `qt` (for displaying quotes). Simply add the shortcode to any post, page, or widget where you'd like the prayer times to appear.
     37== Usage ==
     38
     39= Using Classic Widget =
     401. Go to **Dashboard >> Appearance >> Widgets**.
     412. Find the **Muslim Prayer Time BD** widget.
     423. Drag and drop it into your sidebar, set a title, and save.
     434. Visit your site to see the Prayer Timetable in your sidebar.
     44
     45= Using Block Widget =
     461. Go to **Dashboard >> Appearance >> Widgets**.
     472. In the editor, click the + (Add Block) button and search for 'Muslim Prayer Time BD'.
     483. Click to add the block to your desired area or page.
     494. Customize settings to display Prayer time, Sehri time, or both.
     50
     51= Using Shortcode =
     52Use the shortcode `[prayer_time]` to display the Prayer Timetable anywhere. Customize it with optional attributes:
     53– `ct` (default city)
     54– `qt` (display quotes)
     55Add the shortcode to any post, page, or widget.
    4056
    4157
    4258= Features: =
    43  Auto generated prayer timetable.
    44  Option to adjust prayer time and sehri time.
    45  Option to display prayer timetable for any district of Bangladesh.
    46  Option to display prayer timetable using shortcode in any post/page.
    47  Option to select the default city using the `ct` shortcode attribute.
    48  Option to display Islamic quotes using the `qt` shortcode attribute.
    49  Option to show various Islamic Quotes below the prayer timetable.
    50  Option to set font size, font weight, and font color for the Islamic Quotes.
    51  Option to set background color for the Islamic Quotes.
    52  Option to set time interval between Islamic Quotes.
    53  Option to display Sehri last time.
    54  Option to set Prayer names.
    55  Option to set time format (12/24 hours and AM/PM).
    56  Option to set Sehri and Iftar card name.
    57  Unlimited background color for Prayer name and time.
    58  Unlimited background color for Sehri and Iftar time.
    59  Unlimited font color for Prayer name and time.
    60  Unlimited font color for Sehri time.
    61  Option to set font weight.
    62  Option to set text align.
    63  Option to set prayer image.
    64  Option to remove plugin settings from the database on uninstallation.
    65  Option to set the maximum width for prayer time display.
    66  Modern and user-friendly admin interface.
    67  Help page with plugin features and usage instructions.
     59* Auto generated prayer timetable.
     60* Option to adjust prayer time and sehri time.
     61* Option to display prayer timetable for any district of Bangladesh.
     62* Option to display prayer timetable using shortcode in any post/page.
     63* Option to select the default city using the `ct` shortcode attribute.
     64* Option to display Islamic quotes using the `qt` shortcode attribute.
     65* Option to show various Islamic Quotes below the prayer timetable.
     66* Option to set font size, font weight, and font color for the Islamic Quotes.
     67* Option to set background color for the Islamic Quotes.
     68* Option to set time interval between Islamic Quotes.
     69* Option to display Sehri last time.
     70* Option to set Prayer names.
     71* Option to set time format (12/24 hours and AM/PM).
     72* Option to set Sehri and Iftar card name.
     73* Unlimited background color for Prayer name and time.
     74* Unlimited background color for Sehri and Iftar time.
     75* Unlimited font color for Prayer name and time.
     76* Unlimited font color for Sehri time.
     77* Option to set font weight.
     78* Option to set text align.
     79* Option to set prayer image.
     80* Option to remove plugin settings from the database on uninstallation.
     81* Option to set the maximum width for prayer time display.
     82* Modern and user-friendly admin interface.
     83* Help page with plugin features and usage instructions.
    6884
    6985
     
    7187
    7288= 1. How can I display the prayer time on my website? =
    73 You can display the prayer time by using the widget in the **Appearance >> Widgets** section of your WordPress dashboard, or by using the provided shortcode in your posts or pages.
     89You can display the prayer time by using the **Muslim Prayer Time BD** widget available in the **Appearance >> Widgets** section of your WordPress dashboard. Alternatively, you can use the provided shortcode in your posts or pages to display the prayer timetable anywhere on your website.
    7490
    7591= 2. How can I adjust the prayer times for my location? =
    76 You can adjust the prayer times by going to the plugin settings and modifying the prayer time for your specific location. You can also manually adjust the times as needed using the options available in the settings.
     92You can adjust the prayer times by going to the plugin settings in the **Prayer Time BD** menu in the WordPress admin dashboard. The settings offer options to manually adjust the prayer times for your specific location. The plugin is built on the official perpetual prayer calendar for Bangladesh, ensuring accurate prayer times.
    7793
    7894= 3. Can I show both prayer and sehri times on the same widget? =
    79 Yes, you can display both prayer and sehri times in the widget. You can choose to show both or display them individually by enabling or disabling the relevant options in the widget settings.
     95Yes, the plugin allows you to display both prayer and sehri (and iftar) times in the widget. You can choose to show both or display them individually by enabling or disabling the relevant options in the widget settings.
    8096
    8197= 4. How do I update the plugin? =
    82 To update the plugin, go to your WordPress dashboard and navigate to Plugins. If there is an update available, you will see the option to update the Muslim Prayer Time BD plugin. Just click on the **Update Now** button.
     98To update the plugin, go to your WordPress dashboard and navigate to **Plugins**. If a new version is available, you will see the option to update the **Muslim Prayer Time BD** plugin. Simply click the **Update Now** button to upgrade to the latest version.
    8399
    84100= 5. What do I do if I encounter a security issue? =
    85 If you encounter any security issues, please ensure you are using the latest version of the plugin. If a new security vulnerability is discovered, we will release an update and inform users accordingly.
     101If you encounter any security issues, make sure you are using the latest version of the plugin. We regularly release updates to address any security vulnerabilities, and you will be informed through update notifications. If an issue arises, please contact us immediately.
     102
     103= 6. Can I customize the appearance of the prayer timetable? =
     104Yes, you can fully customize the appearance of the prayer timetable displayed on your site. The plugin allows you to adjust the font color, size, weight, and background color for both prayer names and times. You can also set the text alignment and choose between a 12-hour or 24-hour time format to match your site's theme.
     105
     106= 7. Can I display Sehri and Iftar times during Ramadan? =
     107Yes, during Ramadan, the plugin gives you the option to display both Sehri and Iftar times. These times can be displayed alongside the regular prayer times or separately, depending on your settings. You can also set custom names for the Sehri and Iftar cards.
     108
     109= 8. Can I use different default cities for different widgets? =
     110Yes, the plugin includes a new `ct` shortcode attribute, which allows you to set a different default city for each widget or shortcode instance. This feature is particularly useful if you are displaying prayer times for multiple locations on the same page.
     111
     112= 9. How do I display Islamic Quotes with the prayer timetable? =
     113The plugin includes a `qt` shortcode attribute that lets you display Islamic quotes below the prayer timetable. You can enter custom quotes, and if set, they will override the plugin's default quote settings. Additionally, you can set the interval time and the background color for the quotes display.
     114
     115= 10. What changes have been made in version 3.0? =
     116Version 3.0 includes major updates, including a complete transition to **Object-Oriented Programming (OOP)**. Key changes include the introduction of the `ct` and `qt` shortcode attributes, new customization options for font size, color, and weight for prayer times and Islamic quotes, and a redesigned admin interface. Please refer to the **Instructions after upgrading to version 3.0** section for details on settings changes.
     117
     118= 11. What should I do after upgrading to version 3.0? =
     119After upgrading to version 3.0, please review the plugin's settings. Due to structural changes in the settings, some previous settings may have been lost or altered. While we’ve tried to migrate old options to the new ones, manual adjustments may be necessary. Also, the Prayer Settings menu has been moved to the **Prayer Time BD** section in the WordPress admin dashboard.
    86120
    87121
     
    93127== Upgrade Notice ==
    94128
     129= 3.0.1 =
     130– Updated widget to set default city and display Islamic quotes.
     131– Fixed time calculation for accurate prayer times in Bangladesh (UTC+6), regardless of WordPress timezone.
     132
    95133= 3.0 =
    96 This update introduces a major refactor with full implementation of Object-Oriented Programming (OOP). Key new features include the ability to remove plugin settings on uninstallation, customizable font options for prayer and Sehri/Iftar times, and options to display Islamic quotes with adjustable settings. We've added two new shortcode attributes: **ct** (for default city) and **qt** (for custom quotes). The Prayer Time settings have been moved to the new **Prayer Time BD** menu, and the admin interface has been enhanced for a more modern and user-friendly experience. Be sure to check out the new Help page for full plugin usage instructions.
     134– Major refactor with full OOP implementation.
     135– New options to display Islamic quotes with adjustable settings.
     136– Added two new shortcode attributes: **ct** (default city) & **qt** (custom quotes).
     137– Prayer Time settings moved to the new **Prayer Time BD** menu.
     138– Visit the new Help page for full usage instructions.
    97139
    98140
    99141== Changelog ==
     142
     143= 3.0.1 (19 February 2025) =
     144* Widget has been updated by adding option to set default city and Islamic quotes.
     145* Fixed time calculation issues for prayer times to ensure accurate display in Bangladesh time (UTC+6) regardless of WordPress timezone settings.
    100146
    101147= 3.0 (18 February 2025) =
     
    178224
    179225== Installation ==
    180 
    181 1. Upload the whole plugin folder to your /wp-content/plugins/ folder.
    182 2. Install and activate the plugin.
    183 3. Go to: Appearance >> Widgets.
    184 4. Drag and drop 'Muslim Prayer Time BD' widget in your sidebar.
    185 5. To display Sehri last time go to Settings >> Prayer Settings and enable Sehri time.
     226`Muslim Prayer Time BD` can be installed in two convenient ways: manually or directly from the WordPress plugin directory.
     227
     228**Manual Installation:**
     2291. Log in to your WordPress admin dashboard.
     2302. Navigate to "Plugins" in the left menu and click "Add New."
     2313. Click "Upload Plugin" and choose the muslim-prayer-time-bd.zip file. Click "Install Now."
     2324. Once installed, activate the plugin.
     2335. Configure the ticker settings under "Prayer Time BD" >> "Muslim Prayer Time."
     234
     235**Installation from WordPress Plugin Directory:**
     2361. Log in to your WordPress admin dashboard.
     2372. In the left menu, click "Plugins," then select "Add New."
     2383. In the search field, type "Muslim Prayer Time BD" and press Enter.
     2394. Locate the plugin in the search results and click the "Install Now" button.
     2405. After installation, activate the plugin.
     2416. Configure the ticker settings under "Prayer Time BD" >> "Muslim Prayer Time."
    186242
    187243
     
    1972534. Multiple Prayer Timetables with Islamic Quotes.
    1982545. Prayer Table General Options.
     2556. Search for `Muslim` and see the `Muslim Prayer Time BD` widget in the list.
     2567. `Muslim Prayer Time BD` widget with 4 input options.
  • muslim-prayer-time-bd/trunk/settings/mptbd-class.settings-api.php

    r3242321 r3243224  
    1212 * @example example/oop-example.php How to use the class
    1313 *
    14  * @package Muslim Prayer Time BD - v3.0 - 18 February, 2025
     14 * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
    1515 * @link https://www.realwebcare.com/
    1616 */
  • muslim-prayer-time-bd/trunk/settings/mptbd-settings.php

    r3242321 r3243224  
    77 * It also includes functionality for displaying a help page, adding menu items, and retrieving pages.
    88 *
    9  * @package Muslim Prayer Time BD - v3.0 - 18 February, 2025
     9 * @package Muslim Prayer Time BD - v3.0.1 - 18 February, 2025
    1010 * @link https://www.realwebcare.com/
    1111 */
Note: See TracChangeset for help on using the changeset viewer.