Plugin Directory

Changeset 3227121


Ignore:
Timestamp:
01/22/2025 11:37:27 PM (15 months ago)
Author:
mnaopu
Message:

Update

Location:
daily-motivation/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • daily-motivation/trunk/daily-motivation.php

    r1698580 r3227121  
    11<?php
    22/*
    3 Plugin Name: Daily Motivation
    4 Plugin URI: http://learn-with-mnaopu.blogspot.com
    5 Description: This is not just a simple plugin, it will help you to motivate in your heart and work.
    6 This plugin for admin area.
     3Plugin Name: Motivational Quotes Dashboard Widget
     4Plugin URI: https://profiles.wordpress.org/mnaopu/
     5Description: A plugin to display a motivational quote in the WordPress dashboard.
    76Author: Md. Naeem Ahmed Opu
    8 Version: 1.5
     7Version: 2.0
    98Author URI: http://profiles.wordpress.org/mnaopu
     9License: GPL2
     10
    1011*/
    1112
    12 
    13 //Admin Notice
    14 function motivation_quotes_notice() {
    15     ?>
    16     <div class="notice notice-success is-dismissible">
    17         <p><?php _e( 'Thanks! For Using <strong>Motivational Quotes</strong> Plugin', '' ); ?></p>
    18     </div>
    19     <?php
     13// Prevent direct access to the file
     14if (!defined('ABSPATH')) {
     15    exit;
    2016}
    2117
    22 function motivational_quotes_message() {
    23     /** These are the quotes of Motivational */
    24     $quotes = "Life is about making an impact, not making an income. -Kevin Kruse
    25     Whatever the mind of man can conceive and believe, it can achieve. –Napoleon Hill
    26     Strive not to be a success, but rather to be of value. –Albert Einstein
    27     Two roads diverged in a wood, and I—I took the one less traveled by, And that has made all the difference.  –Robert Frost
    28     I attribute my success to this: I never gave or took any excuse. –Florence Nightingale
    29     I've missed more than 9000 shots in my career. I've lost almost 300 games. 26 times I've been trusted to take the game winning shot and missed. I've failed over and over and over again in my life. And that is why I succeed. –Michael Jordan
    30     The most difficult thing is the decision to act, the rest is merely tenacity. –Amelia Earhart
    31     Every strike brings me closer to the next home run. –Babe Ruth
    32     Definiteness of purpose is the starting point of all achievement. –W. Clement Stone
    33     Life isn't about getting and having, it's about giving and being. –Kevin Kruse
    34     Life is what happens to you while you’re busy making other plans. –John Lennon
    35     We become what we think about. –Earl Nightingale
    36     Twenty years from now you will be more disappointed by the things that you didn’t do than by the ones you did do, so throw off the bowlines, sail away from safe harbor, catch the trade winds in your sails.  Explore, Dream, Discover. –Mark Twain
    37     Life is 10% what happens to me and 90% of how I react to it. –Charles Swindoll
    38     The most common way people give up their power is by thinking they don’t have any. –Alice Walker
    39     The mind is everything. What you think you become.  –Buddha
    40     The best time to plant a tree was 20 years ago. The second best time is now. –Chinese Proverb
    41     An unexamined life is not worth living. –Socrates
    42     Eighty percent of success is showing up. –Woody Allen
    43     Your time is limited, so don’t waste it living someone else’s life. –Steve Jobs
    44     Winning isn’t everything, but wanting to win is. –Vince Lombardi
    45     I am not a product of my circumstances. I am a product of my decisions. –Stephen Covey
    46     Every child is an artist.  The problem is how to remain an artist once he grows up. –Pablo Picasso
    47     You can never cross the ocean until you have the courage to lose sight of the shore. –Christopher Columbus
    48     I’ve learned that people will forget what you said, people will forget what you did, but people will never forget how you made them feel. –Maya Angelou
    49     Either you run the day, or the day runs you. –Jim Rohn
    50     Whether you think you can or you think you can’t, you’re right. –Henry Ford
    51     The two most important days in your life are the day you are born and the day you find out why. –Mark Twain
    52     Whatever you can do, or dream you can, begin it.  Boldness has genius, power and magic in it. –Johann Wolfgang von Goethe
    53     The best revenge is massive success. –Frank Sinatra
    54     People often say that motivation doesn’t last. Well, neither does bathing.  That’s why we recommend it daily. –Zig Ziglar
    55     Life shrinks or expands in proportion to one's courage. –Anais Nin
    56     If you hear a voice within you say “you cannot paint,” then by all means paint and that voice will be silenced. –Vincent Van Gogh
    57     There is only one way to avoid criticism: do nothing, say nothing, and be nothing. –Aristotle
    58     Ask and it will be given to you; search, and you will find; knock and the door will be opened for you. –Jesus
    59     The only person you are destined to become is the person you decide to be. –Ralph Waldo Emerson
    60     Go confidently in the direction of your dreams.  Live the life you have imagined. –Henry David Thoreau
    61     When I stand before God at the end of my life, I would hope that I would not have a single bit of talent left and could say, I used everything you gave me. –Erma Bombeck
    62     Few things can help an individual more than to place responsibility on him, and to let him know that you trust him.  –Booker T. Washington
    63     Certain things catch your eye, but pursue only those that capture the heart. – Ancient Indian Proverb
    64     Believe you can and you’re halfway there. –Theodore Roosevelt
    65     Everything you’ve ever wanted is on the other side of fear. –George Addair
    66     We can easily forgive a child who is afraid of the dark; the real tragedy of life is when men are afraid of the light. –Plato
    67     Teach thy tongue to say, I do not know, and thous shalt progress. –Maimonides
    68     Start where you are. Use what you have.  Do what you can. –Arthur Ashe
    69     When I was 5 years old, my mother always told me that happiness was the key to life.  When I went to school, they asked me what I wanted to be when I grew up.  I wrote down ‘happy’.  They told me I didn’t understand the assignment, and I told them they didn’t understand life. –John Lennon
    70     Fall seven times and stand up eight. –Japanese Proverb
    71     When one door of happiness closes, another opens, but often we look so long at the closed door that we do not see the one that has been opened for us. –Helen Keller
    72     Everything has beauty, but not everyone can see. –Confucius
    73     How wonderful it is that nobody need wait a single moment before starting to improve the world. –Anne Frank
    74     When I let go of what I am, I become what I might be. –Lao Tzu
    75     Life is not measured by the number of breaths we take, but by the moments that take our breath away. –Maya Angelou
    76     Happiness is not something readymade.  It comes from your own actions. –Dalai Lama
    77     If you're offered a seat on a rocket ship, don't ask what seat! Just get on. –Sheryl Sandberg
    78     First, have a definite, clear practical ideal; a goal, an objective. Second, have the necessary means to achieve your ends; wisdom, money, materials, and methods. Third, adjust all your means to that end. –Aristotle
    79     If the wind will not serve, take to the oars. –Latin Proverb
    80     You can’t fall if you don’t climb.  But there’s no joy in living your whole life on the ground. –Unknown
    81     We must believe that we are gifted for something, and that this thing, at whatever cost, must be attained. –Marie Curie
    82     Too many of us are not living our dreams because we are living our fears. –Les Brown
    83     Challenges are what make life interesting and overcoming them is what makes life meaningful. –Joshua J. Marine
    84     If you want to lift yourself up, lift up someone else. –Booker T. Washington
    85     I have been impressed with the urgency of doing. Knowing is not enough; we must apply. Being willing is not enough; we must do. –Leonardo da Vinci
    86     Limitations live only in our minds.  But if we use our imaginations, our possibilities become limitless. –Jamie Paolinetti
    87     You take your life in your own hands, and what happens? A terrible thing, no one to blame. –Erica Jong
    88     What’s money? A man is a success if he gets up in the morning and goes to bed at night and in between does what he wants to do. -Bob Dylan
    89     I didn’t fail the test. I just found 100 ways to do it wrong. –Benjamin Franklin
    90     In order to succeed, your desire for success should be greater than your fear of failure. –Bill Cosby
    91     A person who never made a mistake never tried anything new. – Albert Einstein
    92     The person who says it cannot be done should not interrupt the person who is doing it. –Chinese Proverb
    93     There are no traffic jams along the extra mile. –Roger Staubach
    94     It is never too late to be what you might have been. –George Eliot
    95     You become what you believe. –Oprah Winfrey
    96     I would rather die of passion than of boredom. –Vincent van Gogh
    97     A truly rich man is one whose children run into his arms when his hands are empty. –Unknown
    98     It is not what you do for your children, but what you have taught them to do for themselves, that will make them successful human beings.  –Ann Landers
    99     If you want your children to turn out well, spend twice as much time with them, and half as much money. –Abigail Van Buren
    100     Build your own dreams, or someone else will hire you to build theirs. –Farrah Gray
    101     The battles that count aren't the ones for gold medals. The struggles within yourself--the invisible battles inside all of us--that's where it's at. –Jesse Owens
    102     Education costs money.  But then so does ignorance. –Sir Claus Moser
    103     I have learned over the years that when one's mind is made up, this diminishes fear. –Rosa Parks
    104     It does not matter how slowly you go as long as you do not stop. –Confucius
    105     If you look at what you have in life, you'll always have more. If you look at what you don't have in life, you'll never have enough. –Oprah Winfrey
    106     Remember that not getting what you want is sometimes a wonderful stroke of luck. –Dalai Lama
    107     You can’t use up creativity.  The more you use, the more you have. –Maya Angelou
    108     Dream big and dare to fail. –Norman Vaughan
    109     Our lives begin to end the day we become silent about things that matter. –Martin Luther King Jr.
    110     Do what you can, where you are, with what you have. –Teddy Roosevelt
    111     If you do what you’ve always done, you’ll get what you’ve always gotten. –Tony Robbins
    112     Dreaming, after all, is a form of planning. –Gloria Steinem
    113     It's your place in the world; it's your life. Go on and do all you can with it, and make it the life you want to live. –Mae Jemison
    114     You may be disappointed if you fail, but you are doomed if you don't try. –Beverly Sills
    115     Remember no one can make you feel inferior without your consent. –Eleanor Roosevelt
    116     Life is what we make it, always has been, always will be. –Grandma Moses
    117     The question isn’t who is going to let me; it’s who is going to stop me. –Ayn Rand
    118     When everything seems to be going against you, remember that the airplane takes off against the wind, not with it. –Henry Ford
    119     It’s not the years in your life that count. It’s the life in your years. –Abraham Lincoln
    120     Change your thoughts and you change your world. –Norman Vincent Peale
    121     Either write something worth reading or do something worth writing. –Benjamin Franklin
    122     Nothing is impossible, the word itself says, “I’m possible!” –Audrey Hepburn
    123     The only way to do great work is to love what you do. –Steve Jobs
    124     If you can dream it, you can achieve it. –Zig Ziglar
    125 ";
     18// Add the dashboard widget
     19add_action('wp_dashboard_setup', 'motivational_quotes_dashboard_widget');
    12620
    127     $quotes = explode( "\n", $quotes );
    128 
    129     return wptexturize( $quotes[ mt_rand( 0, count( $quotes ) - 1 ) ] );
     21function motivational_quotes_dashboard_widget() {
     22    wp_add_dashboard_widget(
     23        'motivational_quotes_widget', // Widget ID
     24        'Motivational Quote',         // Widget Title
     25        'display_motivational_quote'  // Callback function
     26    );
    13027}
    13128
    132 function motivation_quotes() {
    133     $mquotes = motivational_quotes_message();
    134     echo "<p id='quotes'>$mquotes</p>";
     29// Display a random motivational quote
     30function display_motivational_quote() {
     31    $quotes = [
     32        "The best way to predict the future is to create it. – Peter Drucker",
     33        "Success is not final, failure is not fatal: It is the courage to continue that counts. – Winston Churchill",
     34        "Don't watch the clock; do what it does. Keep going. – Sam Levenson",
     35        "The secret of getting ahead is getting started. – Mark Twain",
     36        "Hardships often prepare ordinary people for an extraordinary destiny. – C.S. Lewis",
     37        "Believe you can and you're halfway there. – Theodore Roosevelt",
     38        "Act as if what you do makes a difference. It does. – William James",
     39        "Keep your face always toward the sunshine—and shadows will fall behind you. – Walt Whitman",
     40        "What lies behind us and what lies before us are tiny matters compared to what lies within us. – Ralph Waldo Emerson",
     41        "You are never too old to set another goal or to dream a new dream. – C.S. Lewis"
     42    ];
     43
     44    // Select a random quote
     45    $random_quote = $quotes[array_rand($quotes)];
     46
     47    // Display the quote
     48    echo "<p style='font-size: 16px; font-style: italic; text-align: center; margin: 20px 0;'>\"$random_quote\"</p>";
    13549}
    13650
    137 add_action( 'admin_notices', 'motivation_quotes' );
     51// Add custom styles for the widget
     52add_action('admin_enqueue_scripts', 'motivational_quotes_styles');
    13853
    139 function daily_motivation() {
    140     $y = is_rtl() ? 'left' : 'right';
    141 
    142     echo "
    143     <style type='text/css'>
    144     #mq {
    145         float: $y;
    146         padding-$y: 18px;
    147         padding-top: 8px;       
    148         font-size: 20px;
    149         font-weight:bold;
    150     }
    151     </style>
    152     ";
     54function motivational_quotes_styles() {
     55    echo "
     56    <style>
     57        #motivational_quotes_widget .inside {
     58            text-align: center;
     59        }
     60        #motivational_quotes_widget p {
     61            color: #0073aa;
     62            font-weight: bold;
     63        }
     64    </style>
     65    ";
    15366}
    154 
    155 add_action( 'admin_head', 'daily_motivation' );
    156 
    15767?>
  • daily-motivation/trunk/readme.txt

    r1727763 r3227121  
    1 === Daily Motivation ===
     1=== Motivational Quotes Dashboard Widget ===
    22Contributors: Md. Naeem Ahmed Opu
    3 Donate link: http://learn-with-mnaopu.blogspot.com
    4 Tags: motivational quotes, inspire quotes, quotes of the day, quotes motivational
     3Donate link: paypal.me/mnaotech
     4Tags: motivational quotes, inspire quotes, quotes of the day, quotes motivational, motivational widget
    55Requires at least: 3.3
    6 Tested up to: 4.8
     6Tested up to: 6.7.1
    77Stable tag: 1.5
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 This is not just a simple plugin, it will help you to motivate in your heart and work.
    12 This plugin for admin area.
     11A plugin to display a motivational quote in the WordPress dashboard.
    1312
    1413== Description ==
    1514
    16 This is not just a simple plugin, it will help you to motivate in your heart and work.
    17 This plugin for admin area.
     15A plugin to display a motivational quote in the WordPress dashboard.
    1816
    1917== Installation ==
Note: See TracChangeset for help on using the changeset viewer.